Merge "Use consistent env variable naming"
This commit is contained in:
commit
59c689d4e4
@ -268,10 +268,11 @@ class OpenStackManilaShell(object):
|
|||||||
|
|
||||||
parser.add_argument('--bypass-url',
|
parser.add_argument('--bypass-url',
|
||||||
metavar='<bypass-url>',
|
metavar='<bypass-url>',
|
||||||
default=cliutils.env('MANILACLIENT_BYPASS_URL'),
|
default=cliutils.env('OS_MANILA_BYPASS_URL',
|
||||||
|
'MANILACLIENT_BYPASS_URL'),
|
||||||
help=("Use this API endpoint instead of the "
|
help=("Use this API endpoint instead of the "
|
||||||
"Service Catalog. Defaults to "
|
"Service Catalog. Defaults to "
|
||||||
"env[MANILACLIENT_BYPASS_URL]."))
|
"env[OS_MANILA_BYPASS_URL]."))
|
||||||
parser.add_argument('--bypass_url',
|
parser.add_argument('--bypass_url',
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
@ -283,24 +284,29 @@ class OpenStackManilaShell(object):
|
|||||||
|
|
||||||
parser.add_argument('--service-name',
|
parser.add_argument('--service-name',
|
||||||
metavar='<service-name>',
|
metavar='<service-name>',
|
||||||
default=cliutils.env('MANILA_SERVICE_NAME'),
|
default=cliutils.env('OS_MANILA_SERVICE_NAME',
|
||||||
help='Defaults to env[MANILA_SERVICE_NAME].')
|
'MANILA_SERVICE_NAME'),
|
||||||
|
help='Defaults to env[OS_MANILA_SERVICE_NAME].')
|
||||||
parser.add_argument('--service_name',
|
parser.add_argument('--service_name',
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--share-service-name',
|
parser.add_argument('--share-service-name',
|
||||||
metavar='<share-service-name>',
|
metavar='<share-service-name>',
|
||||||
default=cliutils.env('MANILA_share_service_name'),
|
default=cliutils.env(
|
||||||
help='Defaults to env[MANILA_share_service_name].')
|
'OS_MANILA_SHARE_SERVICE_NAME',
|
||||||
|
'MANILA_share_service_name'),
|
||||||
|
help='Defaults to env'
|
||||||
|
'[OS_MANILA_SHARE_SERVICE_NAME].')
|
||||||
parser.add_argument('--share_service_name',
|
parser.add_argument('--share_service_name',
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--endpoint-type',
|
parser.add_argument('--endpoint-type',
|
||||||
metavar='<endpoint-type>',
|
metavar='<endpoint-type>',
|
||||||
default=cliutils.env(
|
default=cliutils.env(
|
||||||
|
'OS_MANILA_ENDPOINT_TYPE',
|
||||||
'MANILA_ENDPOINT_TYPE',
|
'MANILA_ENDPOINT_TYPE',
|
||||||
default=DEFAULT_MANILA_ENDPOINT_TYPE),
|
default=DEFAULT_MANILA_ENDPOINT_TYPE),
|
||||||
help='Defaults to env[MANILA_ENDPOINT_TYPE] or '
|
help='Defaults to env[OS_MANILA_ENDPOINT_TYPE] or '
|
||||||
+ DEFAULT_MANILA_ENDPOINT_TYPE + '.')
|
+ DEFAULT_MANILA_ENDPOINT_TYPE + '.')
|
||||||
parser.add_argument('--endpoint_type',
|
parser.add_argument('--endpoint_type',
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
@ -135,12 +135,17 @@ class OpenstackManilaShellTest(utils.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@ddt.data(
|
@ddt.data(
|
||||||
{"env_vars": {"MANILACLIENT_BYPASS_URL": "http://foo.url",
|
{"env_vars": {"OS_MANILA_BYPASS_URL": "http://foo.url",
|
||||||
"OS_TOKEN": "foo_token"},
|
"OS_TOKEN": "foo_token"},
|
||||||
"kwargs": {"--os-token": "bar_token",
|
"kwargs": {"--os-token": "bar_token",
|
||||||
"--bypass-url": "http://bar.url"},
|
"--bypass-url": "http://bar.url"},
|
||||||
"expected": {"input_auth_token": "bar_token",
|
"expected": {"input_auth_token": "bar_token",
|
||||||
"service_catalog_url": "http://bar.url"}},
|
"service_catalog_url": "http://bar.url"}},
|
||||||
|
{"env_vars": {"OS_MANILA_BYPASS_URL": "http://foo.url",
|
||||||
|
"OS_TOKEN": "foo_token"},
|
||||||
|
"kwargs": {},
|
||||||
|
"expected": {"input_auth_token": "foo_token",
|
||||||
|
"service_catalog_url": "http://foo.url"}},
|
||||||
{"env_vars": {},
|
{"env_vars": {},
|
||||||
"kwargs": {"--os-token": "bar_token",
|
"kwargs": {"--os-token": "bar_token",
|
||||||
"--bypass-url": "http://bar.url"},
|
"--bypass-url": "http://bar.url"},
|
||||||
@ -155,6 +160,12 @@ class OpenstackManilaShellTest(utils.TestCase):
|
|||||||
"kwargs": {"--bypass-url": "http://bar.url"},
|
"kwargs": {"--bypass-url": "http://bar.url"},
|
||||||
"expected": {"input_auth_token": "foo_token",
|
"expected": {"input_auth_token": "foo_token",
|
||||||
"service_catalog_url": "http://bar.url"}},
|
"service_catalog_url": "http://bar.url"}},
|
||||||
|
{"env_vars": {"MANILACLIENT_BYPASS_URL": "http://foo.url",
|
||||||
|
"OS_MANILA_BYPASS_URL": "http://bar.url",
|
||||||
|
"OS_TOKEN": "foo_token"},
|
||||||
|
"kwargs": {"--os-token": "bar_token"},
|
||||||
|
"expected": {"input_auth_token": "bar_token",
|
||||||
|
"service_catalog_url": "http://bar.url"}},
|
||||||
)
|
)
|
||||||
@ddt.unpack
|
@ddt.unpack
|
||||||
def test_main_success_with_token(self, env_vars, kwargs, expected):
|
def test_main_success_with_token(self, env_vars, kwargs, expected):
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Use consistent environment variable naming. All old
|
||||||
|
variables are still supported due to compatibility reasons.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user