commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/105a53b01211/ Changeset: 105a53b01211 Branch: next-stable User: jmchilton Date: 2014-10-03 05:34:42+00:00 Summary: Another fix for galaxy.ini being conditionally existent. Update scripts/check_eggs.py and scripts/fetch_eggs.py with logic to find the correct config file. These files should be refactored so they can share some of this code the way I refactored the database management scripts I guess. Affected #: 2 files diff -r 0e384a367f45709f89774d7eb8e25807c6c900db -r 105a53b01211993297b7ee64251cf3c1677883f7 scripts/check_eggs.py --- a/scripts/check_eggs.py +++ b/scripts/check_eggs.py @@ -10,12 +10,22 @@ from optparse import OptionParser parser = OptionParser() -parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default='config/galaxy.ini' ) +parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default=None ) parser.add_option( '-q', '--quiet', dest='quiet', action="store_true", help='Quiet (no output, only set return code)', default=False ) ( options, args ) = parser.parse_args() -if not os.path.exists( options.config ): - print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], options.config ) + +config_set = True +config = options.config +if config is None: + config_set = False + for name in ['config/galaxy.ini', 'universe_wsgi.ini', 'config/galaxy.ini.sample']: + if os.path.exists(name): + config = name + break + +if not os.path.exists( config ): + print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], config ) sys.exit( 1 ) root = logging.getLogger() @@ -23,15 +33,15 @@ root.addHandler( logging.StreamHandler( sys.stdout ) ) config_arg = '' -if options.config != 'config/galaxy.ini': - config_arg = '-c %s' % options.config +if config_set: + config_arg = '-c %s' % config lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "..", "lib" ) ) sys.path.append( lib ) from galaxy.eggs import Crate -c = Crate( options.config ) +c = Crate( config ) if c.config_missing: if not options.quiet: print "Some of your Galaxy eggs are out of date. Please update them" diff -r 0e384a367f45709f89774d7eb8e25807c6c900db -r 105a53b01211993297b7ee64251cf3c1677883f7 scripts/fetch_eggs.py --- a/scripts/fetch_eggs.py +++ b/scripts/fetch_eggs.py @@ -9,13 +9,22 @@ from optparse import OptionParser parser = OptionParser() -parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default='config/galaxy.ini' ) +parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default=None ) parser.add_option( '-e', '--egg-name', dest='egg_name', help='Egg name (as defined in eggs.ini) to fetch, or "all" for all eggs, even those not needed by your configuration' ) parser.add_option( '-p', '--platform', dest='platform', help='Fetch for a specific platform (by default, eggs are fetched for *this* platform' ) ( options, args ) = parser.parse_args() -if not os.path.exists( options.config ): - print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], options.config ) +config_set = True +config = options.config +if config is None: + config_set = False + for name in ['config/galaxy.ini', 'universe_wsgi.ini', 'config/galaxy.ini.sample']: + if os.path.exists(name): + config = name + break + +if not os.path.exists( config ): + print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], config ) sys.exit( 1 ) root = logging.getLogger() @@ -29,9 +38,9 @@ import pkg_resources if options.platform: - c = Crate( options.config, platform = options.platform ) + c = Crate( config, platform = options.platform ) else: - c = Crate( options.config ) + c = Crate( config ) try: if not options.egg_name: c.resolve() # Only fetch eggs required by the config @@ -49,8 +58,8 @@ print "%s %s is installed at %s" % ( dist.project_name, dist.version, dist.location ) except EggNotFetchable, e: config_arg = '' - if options.config != 'config/galaxy.ini': - config_arg = '-c %s ' % options.config + if config_set: + config_arg = '-c %s ' % config try: assert options.egg_name != 'all' egg = e.eggs[0] https://bitbucket.org/galaxy/galaxy-central/commits/c8ee56c25ce0/ Changeset: c8ee56c25ce0 User: jmchilton Date: 2014-10-03 05:35:00+00:00 Summary: Merge next-stable. Affected #: 2 files diff -r 5928994feff065cac036315489966abf88966cd7 -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 scripts/check_eggs.py --- a/scripts/check_eggs.py +++ b/scripts/check_eggs.py @@ -10,12 +10,22 @@ from optparse import OptionParser parser = OptionParser() -parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default='config/galaxy.ini' ) +parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default=None ) parser.add_option( '-q', '--quiet', dest='quiet', action="store_true", help='Quiet (no output, only set return code)', default=False ) ( options, args ) = parser.parse_args() -if not os.path.exists( options.config ): - print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], options.config ) + +config_set = True +config = options.config +if config is None: + config_set = False + for name in ['config/galaxy.ini', 'universe_wsgi.ini', 'config/galaxy.ini.sample']: + if os.path.exists(name): + config = name + break + +if not os.path.exists( config ): + print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], config ) sys.exit( 1 ) root = logging.getLogger() @@ -23,15 +33,15 @@ root.addHandler( logging.StreamHandler( sys.stdout ) ) config_arg = '' -if options.config != 'config/galaxy.ini': - config_arg = '-c %s' % options.config +if config_set: + config_arg = '-c %s' % config lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "..", "lib" ) ) sys.path.append( lib ) from galaxy.eggs import Crate -c = Crate( options.config ) +c = Crate( config ) if c.config_missing: if not options.quiet: print "Some of your Galaxy eggs are out of date. Please update them" diff -r 5928994feff065cac036315489966abf88966cd7 -r c8ee56c25ce0f9c3c701650b5ddde120d2473c52 scripts/fetch_eggs.py --- a/scripts/fetch_eggs.py +++ b/scripts/fetch_eggs.py @@ -9,13 +9,22 @@ from optparse import OptionParser parser = OptionParser() -parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default='config/galaxy.ini' ) +parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (config/galaxy.ini)', default=None ) parser.add_option( '-e', '--egg-name', dest='egg_name', help='Egg name (as defined in eggs.ini) to fetch, or "all" for all eggs, even those not needed by your configuration' ) parser.add_option( '-p', '--platform', dest='platform', help='Fetch for a specific platform (by default, eggs are fetched for *this* platform' ) ( options, args ) = parser.parse_args() -if not os.path.exists( options.config ): - print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], options.config ) +config_set = True +config = options.config +if config is None: + config_set = False + for name in ['config/galaxy.ini', 'universe_wsgi.ini', 'config/galaxy.ini.sample']: + if os.path.exists(name): + config = name + break + +if not os.path.exists( config ): + print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], config ) sys.exit( 1 ) root = logging.getLogger() @@ -29,9 +38,9 @@ import pkg_resources if options.platform: - c = Crate( options.config, platform = options.platform ) + c = Crate( config, platform = options.platform ) else: - c = Crate( options.config ) + c = Crate( config ) try: if not options.egg_name: c.resolve() # Only fetch eggs required by the config @@ -49,8 +58,8 @@ print "%s %s is installed at %s" % ( dist.project_name, dist.version, dist.location ) except EggNotFetchable, e: config_arg = '' - if options.config != 'config/galaxy.ini': - config_arg = '-c %s ' % options.config + if config_set: + config_arg = '-c %s ' % config try: assert options.egg_name != 'all' egg = e.eggs[0] Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org