def parse_args(args=None): usage = """ Usage: keystone-manage [options] type action [id [attributes]] type : %s action : %s id : name or id attributes : depending on type... users : password, tenant tokens : user, tenant, expiration role list [tenant] will list roles granted on that tenant options -c | --config-file : config file to use -d | --debug : debug mode Example: keystone-manage user add Admin P@ssw0rd """ % (", ".join(OBJECTS), ", ".join(ACTIONS)) # Initialize a parser for our configuration paramaters parser = RaisingOptionParser(usage, version='%%prog %s' % keystone.version()) _common_group = config.add_common_options(parser) config.add_log_options(parser) # Parse command-line and load config (options, args) = config.parse_options(parser, args) _config_file, conf = config.load_paste_config('admin', options, args) config.setup_logging(options, conf) db.configure_backends(conf.global_conf) return args
def parse_args(args=None): usage = "usage: %prog [options] type command [id [attributes]]" # Initialize a parser for our configuration paramaters parser = RaisingOptionParser(usage, version='%%prog %s' % keystone.version()) _common_group = config.add_common_options(parser) config.add_log_options(parser) # Parse command-line and load config (options, args) = config.parse_options(parser, args) _config_file, conf = config.load_paste_config('admin', options, args) # Set things up to run the command debug = options.get('debug') or conf.get('debug', False) debug = debug in [True, "True", "1"] verbose = options.get('verbose') or conf.get('verbose', False) verbose = verbose in [True, "True", "1"] if debug or verbose: _config_file = config.find_config_file(options, args) config.setup_logging(options, conf) db.configure_backends(conf.global_conf) return args
def get_options(args=None): # Initialize a parser for our configuration paramaters parser = RaisingOptionParser() config.add_common_options(parser) config.add_log_options(parser) # Parse command-line and load config (options, args) = config.parse_options(parser, list(args)) _config_file, conf = config.load_paste_config('admin', options, args) conf.global_conf.update(conf.local_conf) return conf.global_conf
def parse_args(args=None): usage = "usage: %prog [options] type command [id [attributes]]" # Initialize a parser for our configuration paramaters parser = RaisingOptionParser(usage, version='%%prog %s' % keystone.version()) _common_group = config.add_common_options(parser) config.add_log_options(parser) # Parse command-line and load config (options, args) = config.parse_options(parser, args) _config_file, conf = config.load_paste_config('admin', options, args) config.setup_logging(options, conf) db.configure_backends(conf.global_conf) return args