summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-24 20:22:57 +0000
committerGerrit Code Review <review@openstack.org>2017-08-24 20:22:57 +0000
commit63acc8dbb9674168d49a6ef68ca6095501090409 (patch)
tree4869fa7a30f52198d897db617e2375199dd3483b
parent7813c4a711f4b408a1f52f16ac98ebccef4edc6f (diff)
parent2efa976b63e47741349a5f61206b9677d2453b3d (diff)
downloadosprofiler-63acc8dbb9674168d49a6ef68ca6095501090409.tar.gz
Merge "Do not require OpenStack authentication to run osprofiler CLI"
-rw-r--r--osprofiler/cmd/shell.py25
-rw-r--r--osprofiler/tests/unit/cmd/test_shell.py33
2 files changed, 0 insertions, 58 deletions
diff --git a/osprofiler/cmd/shell.py b/osprofiler/cmd/shell.py
index f48f23b..0087eb5 100644
--- a/osprofiler/cmd/shell.py
+++ b/osprofiler/cmd/shell.py
@@ -37,31 +37,6 @@ class OSProfilerShell(object):
args = self._get_base_parser().parse_args(argv)
opts.set_defaults(cfg.CONF)
- if not (args.os_auth_token and args.ceilometer_url):
- if not args.os_username:
- raise exc.CommandError(
- "You must provide a username via either --os-username or "
- "via env[OS_USERNAME]")
-
- if not args.os_password:
- raise exc.CommandError(
- "You must provide a password via either --os-password or "
- "via env[OS_PASSWORD]")
-
- if self._no_project_and_domain_set(args):
- # steer users towards Keystone V3 API
- raise exc.CommandError(
- "You must provide a project_id via either --os-project-id "
- "or via env[OS_PROJECT_ID] and a domain_name via either "
- "--os-user-domain-name or via env[OS_USER_DOMAIN_NAME] or "
- "a domain_id via either --os-user-domain-id or via "
- "env[OS_USER_DOMAIN_ID]")
-
- if not args.os_auth_url:
- raise exc.CommandError(
- "You must provide an auth url via either --os-auth-url or "
- "via env[OS_AUTH_URL]")
-
args.func(args)
def _get_base_parser(self):
diff --git a/osprofiler/tests/unit/cmd/test_shell.py b/osprofiler/tests/unit/cmd/test_shell.py
index 20293ea..9689b71 100644
--- a/osprofiler/tests/unit/cmd/test_shell.py
+++ b/osprofiler/tests/unit/cmd/test_shell.py
@@ -92,39 +92,6 @@ class ShellTestCase(test.TestCase):
"Expected: `osprofiler.exc.CommandError` is raised with "
"message: '%s'." % expected_message)
- def test_username_is_not_presented(self):
- os.environ.pop("OS_USERNAME")
- msg = ("You must provide a username via either --os-username or "
- "via env[OS_USERNAME]")
- self._test_with_command_error(self._trace_show_cmd(), msg)
-
- def test_password_is_not_presented(self):
- os.environ.pop("OS_PASSWORD")
- msg = ("You must provide a password via either --os-password or "
- "via env[OS_PASSWORD]")
- self._test_with_command_error(self._trace_show_cmd(), msg)
-
- def test_auth_url(self):
- os.environ.pop("OS_AUTH_URL")
- msg = ("You must provide an auth url via either --os-auth-url or "
- "via env[OS_AUTH_URL]")
- self._test_with_command_error(self._trace_show_cmd(), msg)
-
- def test_no_project_and_domain_set(self):
- os.environ.pop("OS_PROJECT_ID")
- os.environ.pop("OS_PROJECT_NAME")
- os.environ.pop("OS_TENANT_ID")
- os.environ.pop("OS_TENANT_NAME")
- os.environ.pop("OS_USER_DOMAIN_ID")
- os.environ.pop("OS_USER_DOMAIN_NAME")
-
- msg = ("You must provide a project_id via either --os-project-id or "
- "via env[OS_PROJECT_ID] and a domain_name via either "
- "--os-user-domain-name or via env[OS_USER_DOMAIN_NAME] or a "
- "domain_id via either --os-user-domain-id or via "
- "env[OS_USER_DOMAIN_ID]")
- self._test_with_command_error(self._trace_show_cmd(), msg)
-
def test_trace_show_ceilometerclient_is_missed(self):
sys.modules["ceilometerclient"] = None
sys.modules["ceilometerclient.client"] = None