def password(self): if self._validate_string(self.args.os_password): return self.args.os_password verify_pass = ( strutils.bool_from_string(cliutils.env("OS_VERIFY_PASSWORD")) ) return self._prompt_password(verify_pass)
def password(self): if self._validate_string(self.args.os_password): return self.args.os_password verify_pass = ( strutils.bool_from_string(cliutils.env("OS_VERIFY_PASSWORD")) ) return self._prompt_password(verify_pass)
def get_base_parser(self): parser = ZunClientArgumentParser( prog='zun', description=__doc__.strip(), epilog='See "zun help COMMAND" ' 'for help on a specific command.', add_help=False, formatter_class=OpenStackHelpFormatter, ) # Global arguments parser.add_argument('-h', '--help', action='store_true', help=argparse.SUPPRESS) parser.add_argument('--version', action='version', version=version.version_info.version_string()) parser.add_argument('--debug', default=False, action='store_true', help="Print debugging output.") parser.add_argument('--os-cache', default=strutils.bool_from_string( cliutils.env('OS_CACHE', default=False)), action='store_true', help="Use the auth token cache. Defaults to False " "if env[OS_CACHE] is not set.") parser.add_argument('--os-region-name', metavar='<region-name>', default=os.environ.get('OS_REGION_NAME'), help='Region name. Default=env[OS_REGION_NAME].') # TODO(mattf) - add get_timings support to Client # parser.add_argument('--timings', # default=False, # action='store_true', # help="Print call timing info") # TODO(mattf) - use timeout # parser.add_argument('--timeout', # default=600, # metavar='<seconds>', # type=positive_non_zero_float, # help="Set HTTP call timeout (in seconds)") parser.add_argument('--os-project-id', metavar='<auth-project-id>', default=cliutils.env('OS_PROJECT_ID', default=None), help='Defaults to env[OS_PROJECT_ID].') parser.add_argument('--os-project-name', metavar='<auth-project-name>', default=cliutils.env('OS_PROJECT_NAME', default=None), help='Defaults to env[OS_PROJECT_NAME].') parser.add_argument('--os-user-domain-id', metavar='<auth-user-domain-id>', default=cliutils.env('OS_USER_DOMAIN_ID'), help='Defaults to env[OS_USER_DOMAIN_ID].') parser.add_argument('--os-user-domain-name', metavar='<auth-user-domain-name>', default=cliutils.env('OS_USER_DOMAIN_NAME'), help='Defaults to env[OS_USER_DOMAIN_NAME].') parser.add_argument('--os-project-domain-id', metavar='<auth-project-domain-id>', default=cliutils.env('OS_PROJECT_DOMAIN_ID'), help='Defaults to env[OS_PROJECT_DOMAIN_ID].') parser.add_argument('--os-project-domain-name', metavar='<auth-project-domain-name>', default=cliutils.env('OS_PROJECT_DOMAIN_NAME'), help='Defaults to env[OS_PROJECT_DOMAIN_NAME].') parser.add_argument('--service-type', metavar='<service-type>', help='Defaults to container for all ' 'actions.') parser.add_argument('--service_type', help=argparse.SUPPRESS) parser.add_argument('--endpoint-type', metavar='<endpoint-type>', default=cliutils.env( 'OS_ENDPOINT_TYPE', default=DEFAULT_ENDPOINT_TYPE), help='Defaults to env[OS_ENDPOINT_TYPE] or ' + DEFAULT_ENDPOINT_TYPE + '.') # NOTE(dtroyer): We can't add --endpoint_type here due to argparse # thinking usage-list --end is ambiguous; but it # works fine with only --endpoint-type present # Go figure. I'm leaving this here for doc purposes. # parser.add_argument('--endpoint_type', # help=argparse.SUPPRESS) parser.add_argument('--zun-api-version', metavar='<zun-api-ver>', default=cliutils.env( 'ZUN_API_VERSION', default=DEFAULT_API_VERSION), help='Accepts X, X.Y (where X is major, Y is minor' ' part) or "X.latest", defaults to' ' env[ZUN_API_VERSION].') parser.add_argument('--zun_api_version', help=argparse.SUPPRESS) parser.add_argument('--os-cacert', metavar='<ca-certificate>', default=cliutils.env('OS_CACERT', default=None), help='Specify a CA bundle file to use in ' 'verifying a TLS (https) server certificate. ' 'Defaults to env[OS_CACERT].') parser.add_argument('--bypass-url', metavar='<bypass-url>', default=cliutils.env('BYPASS_URL', default=None), dest='bypass_url', help="Use this API endpoint instead of the " "Service Catalog.") parser.add_argument('--bypass_url', help=argparse.SUPPRESS) parser.add_argument('--insecure', default=cliutils.env('ZUNCLIENT_INSECURE', default=False), action='store_true', help="Do not verify https connections") if profiler: parser.add_argument('--profile', metavar='HMAC_KEY', default=cliutils.env('OS_PROFILE', default=None), help='HMAC key to use for encrypting context ' 'data for performance profiling of ' 'operation. This key should be the ' 'value of the HMAC key configured for ' 'the OSprofiler middleware in zun; it ' 'is specified in the Zun configuration ' 'file at "/etc/zun/zun.conf". Without ' 'the key, profiling functions will not ' 'be triggered even if OSprofiler is ' 'enabled on the server side.') # The auth-system-plugins might require some extra options auth.load_auth_system_opts(parser) return parser
def get_base_parser(self): parser = ZunClientArgumentParser( prog='zun', description=__doc__.strip(), epilog='See "zun help COMMAND" ' 'for help on a specific command.', add_help=False, formatter_class=OpenStackHelpFormatter, ) # Global arguments parser.add_argument('-h', '--help', action='store_true', help=argparse.SUPPRESS) parser.add_argument('--version', action='version', version=version.version_info.version_string()) parser.add_argument('--debug', default=False, action='store_true', help="Print debugging output.") parser.add_argument('--os-cache', default=strutils.bool_from_string( cliutils.env('OS_CACHE', default=False)), action='store_true', help="Use the auth token cache. Defaults to False " "if env[OS_CACHE] is not set.") parser.add_argument('--os-region-name', metavar='<region-name>', default=os.environ.get('OS_REGION_NAME'), help='Region name. Default=env[OS_REGION_NAME].') # TODO(mattf) - add get_timings support to Client # parser.add_argument('--timings', # default=False, # action='store_true', # help="Print call timing info") # TODO(mattf) - use timeout # parser.add_argument('--timeout', # default=600, # metavar='<seconds>', # type=positive_non_zero_float, # help="Set HTTP call timeout (in seconds)") parser.add_argument('--os-project-id', metavar='<auth-project-id>', default=cliutils.env('OS_PROJECT_ID', default=None), help='Defaults to env[OS_PROJECT_ID].') parser.add_argument('--os-project-name', metavar='<auth-project-name>', default=cliutils.env('OS_PROJECT_NAME', default=None), help='Defaults to env[OS_PROJECT_NAME].') parser.add_argument('--os-user-domain-id', metavar='<auth-user-domain-id>', default=cliutils.env('OS_USER_DOMAIN_ID'), help='Defaults to env[OS_USER_DOMAIN_ID].') parser.add_argument('--os-user-domain-name', metavar='<auth-user-domain-name>', default=cliutils.env('OS_USER_DOMAIN_NAME'), help='Defaults to env[OS_USER_DOMAIN_NAME].') parser.add_argument('--os-project-domain-id', metavar='<auth-project-domain-id>', default=cliutils.env('OS_PROJECT_DOMAIN_ID'), help='Defaults to env[OS_PROJECT_DOMAIN_ID].') parser.add_argument('--os-project-domain-name', metavar='<auth-project-domain-name>', default=cliutils.env('OS_PROJECT_DOMAIN_NAME'), help='Defaults to env[OS_PROJECT_DOMAIN_NAME].') parser.add_argument('--service-type', metavar='<service-type>', help='Defaults to container for all ' 'actions.') parser.add_argument('--service_type', help=argparse.SUPPRESS) parser.add_argument('--endpoint-type', metavar='<endpoint-type>', default=cliutils.env( 'OS_ENDPOINT_TYPE', default=DEFAULT_ENDPOINT_TYPE), help='Defaults to env[OS_ENDPOINT_TYPE] or ' + DEFAULT_ENDPOINT_TYPE + '.') # NOTE(dtroyer): We can't add --endpoint_type here due to argparse # thinking usage-list --end is ambiguous; but it # works fine with only --endpoint-type present # Go figure. I'm leaving this here for doc purposes. # parser.add_argument('--endpoint_type', # help=argparse.SUPPRESS) parser.add_argument('--zun-api-version', metavar='<zun-api-ver>', default=cliutils.env( 'ZUN_API_VERSION', default=DEFAULT_API_VERSION), help='Accepts X, X.Y (where X is major, Y is minor' ' part) or "X.latest", defaults to' ' env[ZUN_API_VERSION].') parser.add_argument('--zun_api_version', help=argparse.SUPPRESS) parser.add_argument('--os-cacert', metavar='<ca-certificate>', default=cliutils.env('OS_CACERT', default=None), help='Specify a CA bundle file to use in ' 'verifying a TLS (https) server certificate. ' 'Defaults to env[OS_CACERT].') parser.add_argument('--os-cert', metavar='<ca-certificate>', default=cliutils.env('OS_CERT', default=None), help='Specify a client certificate file (for ' 'client auth). ' 'Defaults to env[OS_CERT].') parser.add_argument('--os-key', metavar='<ca-certificate>', default=cliutils.env('OS_KEY', default=None), help='Specify a client certificate key file (for ' 'client auth). ' 'Defaults to env[OS_KEY].') parser.add_argument('--bypass-url', metavar='<bypass-url>', default=cliutils.env('BYPASS_URL', default=None), dest='bypass_url', help="Use this API endpoint instead of the " "Service Catalog.") parser.add_argument('--bypass_url', help=argparse.SUPPRESS) parser.add_argument('--insecure', default=cliutils.env('ZUNCLIENT_INSECURE', default=False), action='store_true', help="Do not verify https connections") if profiler: parser.add_argument('--profile', metavar='HMAC_KEY', default=cliutils.env('OS_PROFILE', default=None), help='HMAC key to use for encrypting context ' 'data for performance profiling of ' 'operation. This key should be the ' 'value of the HMAC key configured for ' 'the OSprofiler middleware in zun; it ' 'is specified in the Zun configuration ' 'file at "/etc/zun/zun.conf". Without ' 'the key, profiling functions will not ' 'be triggered even if OSprofiler is ' 'enabled on the server side.') # The auth-system-plugins might require some extra options auth.load_auth_system_opts(parser) return parser