def populate_parser(parser): parser.add_argument( '--on-auth', metavar='<auth>', default=utils.env('ON_AUTH'), help=('Specify authorization information. For core drivers, ' 'it shall be <username>:<password>. ' 'Defaults to env[ON_USERNAME].')) parser.add_argument( '--on-rpcxml-endpoint', metavar='<auth-url>', default=utils.env('OS_RPCXML_ENDPOINT'), help='Defaults to env[OS_RPCXML_ENDPOINT].') parser.add_argument( '--vmcatcher-images', action='store_true', default=False, help=('If set, include only information on images that ' 'have vmcatcher metadata, ignoring the others.'))
def populate_parser(parser): parser.add_argument( '--on-auth', metavar='<auth>', default=utils.env('ON_AUTH') or 'oneadmin:opennebula', help=('Specify authorization information. For core drivers, ' 'it should be <username>:<password>. ' 'Defaults to env[ON_USERNAME] or oneadmin:opennebula.')) parser.add_argument('--on-rpcxml-endpoint', metavar='<auth-url>', default=utils.env('ON_RPCXML_ENDPOINT') or 'http://localhost:2633/RPC2', help=('Specify OpenNebula XML RPC endpoint. ' 'Defaults to env[ON_RPCXML_ENDPOINT]' ' or http://localhost:2633/RPC2.')) parser.add_argument( '--vmcatcher-images', action='store_true', default=False, help=('If set, include only information on images that ' 'have vmcatcher metadata, ignoring the others.'))
def populate_parser(parser): parser.add_argument( '--on-auth', metavar='<auth>', default=utils.env('ON_AUTH') or 'oneadmin:opennebula', help=('Specify authorization information. For core drivers, ' 'it should be <username>:<password>. ' 'Defaults to env[ON_USERNAME] or oneadmin:opennebula.')) parser.add_argument( '--on-rpcxml-endpoint', metavar='<auth-url>', default=utils.env('ON_RPCXML_ENDPOINT') or 'http://localhost:2633/RPC2', help=('Specify OpenNebula XML RPC endpoint. ' 'Defaults to env[ON_RPCXML_ENDPOINT]' ' or http://localhost:2633/RPC2.')) parser.add_argument( '--cloudkeeper-images', '--vmcatcher-images', action='store_true', default=False, help=('If set, include only information on images that ' 'have cloudkeeper metadata, ignoring the others.'))
def populate_parser(parser): parser.add_argument( '--os-username', metavar='<auth-user-name>', default=utils.env('OS_USERNAME', 'NOVA_USERNAME'), help='Defaults to env[OS_USERNAME].') parser.add_argument( '--os-password', metavar='<auth-password>', default=utils.env('OS_PASSWORD', 'NOVA_PASSWORD'), help='Defaults to env[OS_PASSWORD].') parser.add_argument( '--os-tenant-name', metavar='<auth-tenant-name>', default=utils.env('OS_TENANT_NAME', 'NOVA_PROJECT_ID'), help='Defaults to env[OS_TENANT_NAME].') parser.add_argument( '--os-auth-url', metavar='<auth-url>', default=utils.env('OS_AUTH_URL', 'NOVA_URL'), help='Defaults to env[OS_AUTH_URL].') parser.add_argument( '--os-cacert', metavar='<ca-certificate>', default=utils.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( '--insecure', default=utils.env('NOVACLIENT_INSECURE', default=False), action='store_true', help="Explicitly allow novaclient to perform 'insecure' " "SSL (https) requests. The server's certificate will " 'not be verified against any certificate authorities. ' 'This option should be used with caution.') parser.add_argument( '--legacy-occi-os', default=False, action='store_true', help="Generate information and ids compatible with OCCI-OS, " "e.g. using the flavor name instead of the flavor id.")
def populate_parser(parser): default_auth = "v3password" parser.add_argument('--os-auth-type', '--os-auth-plugin', metavar='<name>', default=default_auth, help='Authentication type to use') plugin = loading_base.get_plugin_loader(default_auth) for opt in plugin.get_options(): # FIXME(aloga): the code below has been commented. This commit has # been cherry picked from another branch that took into account the # VOs and configured projects. The code below needs to be # uncommented whenever Glue2.1 is in place. # NOTE(aloga): we do not want a project to be passed from the CLI, # as we will iterate over it for each configured VO and project. # However, as the plugin is expecting them when parsing the # arguments we need to set them to None before calling the # load_auth_from_argparse_arguments method in the __init__ method # of this class. # if opt.name in ("project-name", "project-id"): # continue parser.add_argument(*opt.argparse_args, default=opt.argparse_default, metavar=opt.metavar, help=opt.help, dest='os_%s' % opt.dest) parser.add_argument( '--insecure', default=utils.env('NOVACLIENT_INSECURE', default=False), action='store_true', help="Explicitly allow novaclient to perform 'insecure' " "SSL (https) requests. The server's certificate will " 'not be verified against any certificate authorities. ' 'This option should be used with caution.') parser.add_argument( '--os-cacert', metavar='<ca-certificate>', default=utils.env('OS_CACERT', default=requests.certs.where()), 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='<certificate>', default=utils.env('OS_CERT', default=None), help='Defaults to env[OS_CERT].') parser.add_argument( '--os-key', metavar='<key>', default=utils.env('OS_KEY', default=None), help='Defaults to env[OS_KEY].') parser.add_argument( '--timeout', default=600, metavar='<seconds>', help='Set request timeout (in seconds).') parser.add_argument( '--legacy-occi-os', default=False, action='store_true', help="Generate information and ids compatible with OCCI-OS, " "e.g. using the flavor name instead of the flavor id.")
def populate_parser(parser): default_auth = "v3password" parser.add_argument('--os-auth-type', '--os-auth-plugin', metavar='<name>', default=default_auth, help='Authentication type to use') plugin = loading_base.get_plugin_loader(default_auth) for opt in plugin.get_options(): # FIXME(aloga): the code below has been commented. This commit has # been cherry picked from another branch that took into account the # VOs and configured projects. The code below needs to be # uncommented whenever Glue2.1 is in place. # NOTE(aloga): we do not want a project to be passed from the CLI, # as we will iterate over it for each configured VO and project. # However, as the plugin is expecting them when parsing the # arguments we need to set them to None before calling the # load_auth_from_argparse_arguments method in the __init__ method # of this class. # if opt.name in ("project-name", "project-id"): # continue parser.add_argument(*opt.argparse_args, default=opt.argparse_default, metavar=opt.metavar, help=opt.help, dest='os_%s' % opt.dest) parser.add_argument( '--insecure', default=utils.env('NOVACLIENT_INSECURE', default=False), action='store_true', help="Explicitly allow novaclient to perform 'insecure' " "SSL (https) requests. The server's certificate will " 'not be verified against any certificate authorities. ' 'This option should be used with caution.') parser.add_argument('--os-cacert', metavar='<ca-certificate>', default=utils.env('OS_CACERT', default=requests.certs.where()), 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='<certificate>', default=utils.env('OS_CERT', default=None), help='Defaults to env[OS_CERT].') parser.add_argument('--os-key', metavar='<key>', default=utils.env('OS_KEY', default=None), help='Defaults to env[OS_KEY].') parser.add_argument('--timeout', default=600, metavar='<seconds>', help='Set request timeout (in seconds).') parser.add_argument( '--legacy-occi-os', default=False, action='store_true', help="Generate information and ids compatible with OCCI-OS, " "e.g. using the flavor name instead of the flavor id.") parser.add_argument( '--select-flavors', default='all', choices=['all', 'public', 'private'], help='Select all (default), public or private flavors/templates.')