本文整理汇总了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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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