当前位置: 首页>>代码示例>>Python>>正文


Python utils.env方法代码示例

本文整理汇总了Python中osc_lib.utils.env方法的典型用法代码示例。如果您正苦于以下问题:Python utils.env方法的具体用法?Python utils.env怎么用?Python utils.env使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osc_lib.utils的用法示例。


在下文中一共展示了utils.env方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(ExportCell, self).get_parser(prog_name)
        parser.add_argument('name', metavar='<cell name>',
                            help=_('Name of the stack used for the additional '
                                   'cell.'))
        parser.add_argument('--control-plane-stack',
                            dest='control_plane_stack',
                            metavar='<control plane stack>',
                            help=_('Name of the environment main Heat stack '
                                   'to export information from. '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))
        parser.add_argument('--cell-stack', '-e', metavar='<cell stack>',
                            help=_('Name of the controller cell Heat stack to '
                                   'export information from. Used in case of: '
                                   'control plane stack -> cell controller '
                                   'stack -> multiple compute stacks'))
        parser.add_argument('--output-file', '-o', metavar='<output file>',
                            help=_('Name of the output file for the cell data '
                                   'export. It will default to "<name>.yaml"'))
        parser.add_argument('--force-overwrite', '-f', action='store_true',
                            default=False,
                            help=_('Overwrite output file if it exists.'))
        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:27,代码来源:overcloud_cell.py

示例2: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(UnprovisionNode, self).get_parser(prog_name)
        parser.add_argument('--stack', dest='stack',
                            help=_('Name or ID of heat stack '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))
        parser.add_argument('--all',
                            help=_('Unprovision every instance in the '
                                   'deployment'),
                            default=False,
                            action="store_true")
        parser.add_argument('-y', '--yes',
                            help=_('Skip yes/no prompt (assume yes)'),
                            default=False,
                            action="store_true")
        parser.add_argument('input',
                            metavar='<baremetal_deployment.yaml>',
                            help=_('Configuration file describing the '
                                   'baremetal deployment'))
        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:23,代码来源:overcloud_node.py

示例3: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(DeleteOvercloud, self).get_parser(prog_name)
        parser.add_argument('stack', nargs='?',
                            help=_('Name or ID of heat stack to delete'
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=osc_utils.env('OVERCLOUD_STACK_NAME'))
        parser.add_argument('-y', '--yes',
                            help=_('Skip yes/no prompt (assume yes).'),
                            default=False,
                            action="store_true")
        parser.add_argument('-s', '--skip-ipa-cleanup',
                            help=_('Skip removing overcloud hosts, services, '
                                   'and DNS records from FreeIPA. This is '
                                   'particularly relevant for deployments '
                                   'using certificates from FreeIPA for TLS. '
                                   'By default, overcloud hosts, services, '
                                   'and DNS records will be removed from '
                                   'FreeIPA before deleting the overcloud. '
                                   'Using this option might require you to '
                                   'manually cleanup FreeIPA later.'),
                            default=False,
                            action="store_true")
        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:25,代码来源:overcloud_delete.py

示例4: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Hook to add global options."""
    parser.add_argument(
        '--os-workflow-api-version',
        metavar='<workflow-api-version>',
        default=utils.env(
            'OS_WORKFLOW_API_VERSION',
            default=DEFAULT_WORKFLOW_API_VERSION),
        help='Workflow API version, default=' +
             DEFAULT_WORKFLOW_API_VERSION +
             ' (Env: OS_WORKFLOW_API_VERSION)')

    return parser 
开发者ID:openstack,项目名称:python-mistralclient,代码行数:15,代码来源:plugin.py

示例5: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Add global options to the parser."""
    parser.add_argument(
        '--os-metrics-api-version',
        metavar='<metrics-api-version>',
        default=utils.env(
            'OS_METRICS_API_VERSION',
            default=DEFAULT_METRICS_API_VERSION),
        help=('Metrics API version, default=' +
              DEFAULT_METRICS_API_VERSION +
              ' (Env: OS_METRICS_API_VERSION)'))
    return parser 
开发者ID:gnocchixyz,项目名称:python-gnocchiclient,代码行数:14,代码来源:osc.py

示例6: _append_monasca_args

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def _append_monasca_args(parser):
        parser.add_argument('--monasca-api-url',
                            default=utils.env('MONASCA_API_URL'),
                            help='Defaults to env[MONASCA_API_URL].')
        parser.add_argument('--monasca_api_url',
                            help=argparse.SUPPRESS)
        parser.add_argument('--monasca-api-version',
                            default=utils.env(
                                'MONASCA_API_VERSION',
                                default='2_0'),
                            help='Defaults to env[MONASCA_API_VERSION] or 2_0')
        parser.add_argument('--monasca_api_version',
                            help=argparse.SUPPRESS)
        return parser 
开发者ID:openstack,项目名称:python-monascaclient,代码行数:16,代码来源:shell.py

示例7: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(ExtractProvisionedNode, self).get_parser(prog_name)
        parser.add_argument('--stack', dest='stack',
                            help=_('Name or ID of heat stack '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))
        parser.add_argument('-o', '--output',
                            metavar='<baremetal_deployment.yaml>',
                            help=_('The output file path describing the '
                                   'baremetal deployment'))
        parser.add_argument('-y', '--yes', default=False, action='store_true',
                            help=_('Skip yes/no prompt for existing files '
                                   '(assume yes).'))
        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:17,代码来源:overcloud_node.py

示例8: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(FFWDUpgradeRun, self).get_parser(prog_name)
        parser.add_argument('--yes',
                            action='store_true',
                            help=_("Use --yes to skip the confirmation "
                                   "required before any ffwd-upgrade "
                                   "operation. Use this with caution! "),
                            )
        parser.add_argument('--static-inventory',
                            dest='static_inventory',
                            action="store",
                            default=None,
                            help=_('Path to an existing ansible inventory to '
                                   'use. If not specified, one will be '
                                   'generated in '
                                   '~/tripleo-ansible-inventory.yaml')
                            )
        parser.add_argument("--ssh-user",
                            dest="ssh_user",
                            action="store",
                            default="tripleo-admin",
                            help=_("DEPRECATED: Only tripleo-admin should be "
                                   "used as ssh user.")
                            )
        parser.add_argument('--stack', dest='stack',
                            help=_('Name or ID of heat stack '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud')
                            )
        parser.add_argument('--no-workflow', dest='no_workflow',
                            action='store_true',
                            default=True,
                            help=_('This option no longer has any effect.')
                            )
        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:38,代码来源:overcloud_ffwd_upgrade.py

示例9: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(ExportOvercloud, self).get_parser(prog_name)
        parser.add_argument('--stack',
                            dest='stack',
                            metavar='<stack>',
                            help=_('Name of the environment main Heat stack '
                                   'to export information from. '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))
        parser.add_argument('--output-file', '-o', metavar='<output file>',
                            help=_('Name of the output file for the stack '
                                   'data export. It will default to '
                                   '"<name>.yaml"'))
        parser.add_argument('--force-overwrite', '-f', action='store_true',
                            default=False,
                            help=_('Overwrite output file if it exists.'))
        parser.add_argument('--config-download-dir',
                            action='store',
                            help=_('Directory to search for config-download '
                                   'export data. Defaults to '
                                   '$HOME/config-download'))
        parser.add_argument('--no-password-excludes',
                            action='store_true',
                            dest='no_password_excludes',
                            help=_('Don''t exclude certain passwords from '
                                   'the password export. Defaults to False '
                                   'in that some passwords will be excluded '
                                   'that are not typically necessary.'))

        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:33,代码来源:overcloud_export.py

示例10: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(Authorize, self).get_parser(prog_name)

        parser.add_argument('--stack', dest='stack',
                            help=_('Name or ID of heat stack '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))

        parser.add_argument(
            '--overcloud-ssh-user',
            default='heat-admin',
            help=_('User for ssh access to overcloud nodes')
        )
        parser.add_argument(
            '--overcloud-ssh-key',
            default=None,
            help=_('Key path for ssh access to overcloud nodes. When'
                   'undefined the key will be autodetected.')
        )
        parser.add_argument(
            '--overcloud-ssh-network',
            help=_('Network name to use for ssh access to overcloud nodes.'),
            default='ctlplane'
        )
        parser.add_argument(
            '--overcloud-ssh-enable-timeout',
            help=_('This option no longer has any effect.'),
            type=int,
            default=constants.ENABLE_SSH_ADMIN_TIMEOUT
        )
        parser.add_argument(
            '--overcloud-ssh-port-timeout',
            help=_('Timeout for the ssh port to become active.'),
            type=int,
            default=constants.ENABLE_SSH_ADMIN_SSH_PORT_TIMEOUT
        )

        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:41,代码来源:overcloud_admin.py

示例11: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Hook to add global options"""
    parser.add_argument(
        '--os-clustering-api-version',
        metavar='<clustering-api-version>',
        default=utils.env(
            'OS_CLUSTERING_API_VERSION',
            default=DEFAULT_CLUSTERING_API_VERSION),
        help='Clustering API version, default=' +
             DEFAULT_CLUSTERING_API_VERSION +
             ' (Env: OS_CLUSTERING_API_VERSION)')
    return parser 
开发者ID:openstack,项目名称:python-senlinclient,代码行数:14,代码来源:plugin.py

示例12: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Hook to add global options."""
    parser.add_argument(
        '--rating-api-version', type=int, default=utils.env(
            'OS_RATING_API_VERSION',
            default=DEFAULT_API_VERSION)
    )
    return parser 
开发者ID:openstack,项目名称:python-cloudkittyclient,代码行数:10,代码来源:osc.py

示例13: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Hook to add global options"""

    parser.add_argument(
        '--os-container-infra-api-version',
        metavar='<container-infra-api-version>',
        default=utils.env(
            'OS_CONTAINER_INFRA_API_VERSION',
            default=DEFAULT_MAJOR_API_VERSION),
        help='Container-Infra API version, default=' +
             DEFAULT_MAJOR_API_VERSION +
             ' (Env: OS_CONTAINER_INFRA_API_VERSION)')
    return parser 
开发者ID:openstack,项目名称:python-magnumclient,代码行数:15,代码来源:plugin.py

示例14: build_option_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def build_option_parser(parser):
    """Hook to add global options."""
    parser.add_argument(
        '--os-tacker-api-version',
        metavar='<tacker-api-version>',
        default=utils.env(
            'OS_TACKER_API_VERSION',
            default=DEFAULT_TACKER_API_VERSION))
    return parser 
开发者ID:openstack,项目名称:python-tackerclient,代码行数:11,代码来源:plugin.py

示例15: get_parser

# 需要导入模块: from osc_lib import utils [as 别名]
# 或者: from osc_lib.utils import env [as 别名]
def get_parser(self, prog_name):
        parser = super(ExternalUpgradeRun, self).get_parser(prog_name)
        parser.add_argument('--static-inventory',
                            dest='static_inventory',
                            action="store",
                            default=None,
                            help=_('Path to an existing ansible inventory to '
                                   'use. If not specified, one will be '
                                   'generated in '
                                   '~/tripleo-ansible-inventory.yaml')
                            )
        parser.add_argument("--ssh-user",
                            dest="ssh_user",
                            action="store",
                            default="tripleo-admin",
                            help=_("DEPRECATED: Only tripleo-admin should be "
                                   "used as ssh user.")
                            )
        parser.add_argument('--tags',
                            dest='tags',
                            action="store",
                            default="",
                            help=_('A string specifying the tag or comma '
                                   'separated list of tags to be passed '
                                   'as --tags to ansible-playbook. ')
                            )
        parser.add_argument('--skip-tags',
                            dest='skip_tags',
                            action="store",
                            default="",
                            help=_('A string specifying the tag or comma '
                                   'separated list of tags to be passed '
                                   'as --skip-tags to ansible-playbook. ')
                            )
        parser.add_argument('--stack', dest='stack',
                            help=_('Name or ID of heat stack '
                                   '(default=Env: OVERCLOUD_STACK_NAME)'),
                            default=utils.env('OVERCLOUD_STACK_NAME',
                                              default='overcloud'))
        parser.add_argument('-e', '--extra-vars', dest='extra_vars',
                            action='append',
                            help=('Set additional variables as key=value or '
                                  'yaml/json'),
                            default=[])
        parser.add_argument('--no-workflow', dest='no_workflow',
                            action='store_true',
                            default=True,
                            help=_('This option no longer has any effect.')
                            )
        parser.add_argument(
            '--limit',
            action='store',
            default=None,
            help=_("A string that identifies a single node or comma-separated"
                   "list of nodes the config-download Ansible playbook "
                   "execution will be limited to. For example: --limit"
                   " \"compute-0,compute-1,compute-5\".")
        )

        return parser 
开发者ID:openstack,项目名称:python-tripleoclient,代码行数:62,代码来源:overcloud_external_upgrade.py


注:本文中的osc_lib.utils.env方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。