diff options
Diffstat (limited to 'heatclient')
-rw-r--r-- | heatclient/_i18n.py | 2 | ||||
-rw-r--r-- | heatclient/osc/plugin.py | 4 | ||||
-rw-r--r-- | heatclient/osc/v1/stack.py | 19 | ||||
-rw-r--r-- | heatclient/tests/unit/test_shell.py | 34 | ||||
-rw-r--r-- | heatclient/v1/shell.py | 3 | ||||
-rw-r--r-- | heatclient/v1/stacks.py | 2 |
6 files changed, 34 insertions, 30 deletions
diff --git a/heatclient/_i18n.py b/heatclient/_i18n.py index f8c6269..4abe87e 100644 --- a/heatclient/_i18n.py +++ b/heatclient/_i18n.py @@ -12,7 +12,7 @@ """oslo.i18n integration module. -See http://docs.openstack.org/developer/oslo.i18n/usage.html +See https://docs.openstack.org/oslo.i18n/latest/user/index.html """ diff --git a/heatclient/osc/plugin.py b/heatclient/osc/plugin.py index 8bc3f15..859a13e 100644 --- a/heatclient/osc/plugin.py +++ b/heatclient/osc/plugin.py @@ -41,13 +41,15 @@ def make_client(instance): if instance.session: kwargs.update({'session': instance.session, 'service_type': API_NAME}) + elif instance.auth_plugin_name == 'token_endpoint': + kwargs.update({'endpoint': instance.auth.url, + 'token': instance.auth.token}) else: endpoint = instance.get_endpoint_for_service_type( API_NAME, region_name=instance.region_name, interface=instance.interface, ) - kwargs.update({'endpoint': endpoint, 'auth_url': instance.auth.auth_url, 'username': instance.auth_ref.username, diff --git a/heatclient/osc/v1/stack.py b/heatclient/osc/v1/stack.py index 4a0c52e..3817bea 100644 --- a/heatclient/osc/v1/stack.py +++ b/heatclient/osc/v1/stack.py @@ -59,9 +59,9 @@ class CreateStack(command.ShowOne): action='append', help=_('Name of a resource to set a pre-create hook to. Resources ' 'in nested stacks can be set using slash as a separator: ' - 'nested_stack/another/my_resource. You can use wildcards ' - 'to match multiple stacks or resources: ' - 'nested_stack/an*/*_resource. This can be specified ' + '``nested_stack/another/my_resource``. You can use ' + 'wildcards to match multiple stacks or resources: ' + '``nested_stack/an*/*_resource``. This can be specified ' 'multiple times') ) parser.add_argument( @@ -210,9 +210,9 @@ class UpdateStack(command.ShowOne): '--pre-update', metavar='<resource>', action='append', help=_('Name of a resource to set a pre-update hook to. Resources ' 'in nested stacks can be set using slash as a separator: ' - 'nested_stack/another/my_resource. You can use wildcards ' - 'to match multiple stacks or resources: ' - 'nested_stack/an*/*_resource. This can be specified ' + '``nested_stack/another/my_resource``. You can use ' + 'wildcards to match multiple stacks or resources: ' + '``nested_stack/an*/*_resource``. This can be specified ' 'multiple times') ) parser.add_argument( @@ -1217,6 +1217,7 @@ class CancelStack(StackActionBase): """Cancel current task for a stack. Supported tasks for cancellation: + * update * create """ @@ -1379,9 +1380,9 @@ class StackHookClear(command.Command): nargs='+', help=_('Resource names with hooks to clear. Resources ' 'in nested stacks can be set using slash as a separator: ' - 'nested_stack/another/my_resource. You can use wildcards ' - 'to match multiple stacks or resources: ' - 'nested_stack/an*/*_resource') + '``nested_stack/another/my_resource``. You can use ' + 'wildcards to match multiple stacks or resources: ' + '``nested_stack/an*/*_resource``') ) return parser diff --git a/heatclient/tests/unit/test_shell.py b/heatclient/tests/unit/test_shell.py index 175eda1..2ea4fd4 100644 --- a/heatclient/tests/unit/test_shell.py +++ b/heatclient/tests/unit/test_shell.py @@ -774,7 +774,7 @@ class ShellTestUserPass(ShellBase): ] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'parent') + self.assertNotRegex(list_text, 'parent') def test_stack_list_show_nested(self): self.register_keystone_auth_fixture() @@ -2918,7 +2918,7 @@ class ShellTestEventsNested(ShellBase): for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'p_eventid1') + self.assertNotRegex(list_text, 'p_eventid1') self.assertRegex(list_text, "%s.*\n.*%s.*\n.*%s.*" % timestamps[1:]) @@ -2942,8 +2942,8 @@ class ShellTestEventsNested(ShellBase): 'stack_name', 'teststack', 'nested'] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'p_eventid2') - self.assertNotRegexpMatches(list_text, 'n_eventid2') + self.assertNotRegex(list_text, 'p_eventid2') + self.assertNotRegex(list_text, 'n_eventid2') self.assertRegex(list_text, "%s.*\n.*%s.*\n" % timestamps[:2]) @@ -3121,9 +3121,9 @@ class ShellTestHookFunctions(ShellBase): required = ['id', 'p_eventid2', 'stack_name', 'teststack', hook_reason] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'p_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid2') + self.assertNotRegex(list_text, 'p_eventid1') + self.assertNotRegex(list_text, 'n_eventid1') + self.assertNotRegex(list_text, 'n_eventid2') def test_hook_poll_pre_update(self): self.register_keystone_auth_fixture() @@ -3136,9 +3136,9 @@ class ShellTestHookFunctions(ShellBase): required = ['id', 'p_eventid2', 'stack_name', 'teststack', hook_reason] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'p_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid2') + self.assertNotRegex(list_text, 'p_eventid1') + self.assertNotRegex(list_text, 'n_eventid1') + self.assertNotRegex(list_text, 'n_eventid2') def test_hook_poll_pre_delete(self): self.register_keystone_auth_fixture() @@ -3151,9 +3151,9 @@ class ShellTestHookFunctions(ShellBase): required = ['id', 'p_eventid2', 'stack_name', 'teststack', hook_reason] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'p_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid1') - self.assertNotRegexpMatches(list_text, 'n_eventid2') + self.assertNotRegex(list_text, 'p_eventid1') + self.assertNotRegex(list_text, 'n_eventid1') + self.assertNotRegex(list_text, 'n_eventid2') def test_hook_poll_bad_status(self): self.register_keystone_auth_fixture() @@ -3887,13 +3887,13 @@ class ShellTestDeployment(ShellBase): ] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'parent') + self.assertNotRegex(list_text, 'parent') list_text = self.shell('deployment-list -s 123') for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'parent') + self.assertNotRegex(list_text, 'parent') def test_deploy_show(self): self.register_keystone_auth_fixture() @@ -4227,7 +4227,7 @@ class ShellTestStandaloneToken(ShellTestUserPass): ] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'parent') + self.assertNotRegex(list_text, 'parent') class MockShellBase(TestCase): @@ -4308,7 +4308,7 @@ class MockShellTestUserPass(MockShellBase): ] for r in required: self.assertRegex(list_text, r) - self.assertNotRegexpMatches(list_text, 'parent') + self.assertNotRegex(list_text, 'parent') if self.jreq_mock.call_args is None: self.assertEqual(1, self.session_jreq_mock.call_count) diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 6f6ff08..e5bf19c 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -633,7 +633,8 @@ def do_stack_cancel_update(hc, args): 'keys.')) @utils.arg('-g', '--global-tenant', action='store_true', default=False, help=_('Display stacks from all tenants. Operation only authorized ' - 'for users who match the policy in heat\'s policy.json.')) + 'for users who match the policy (default or explicitly ' + 'configured in policy.json) in heat.')) @utils.arg('-o', '--show-owner', action='store_true', default=False, help=_('Display stack owner information. This is automatically ' 'enabled when using %(arg)s.') % {'arg': '--global-tenant'}) diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index 1a76286..2484ff4 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -279,7 +279,7 @@ class StackManager(StackChildManager): kwargs['params'] = {"resolve_outputs": False} resp = self.client.get('/stacks/%s' % stack_id, **kwargs) body = utils.get_response_body(resp) - return Stack(self, body.get('stack')) + return Stack(self, body.get('stack'), loaded=True) def template(self, stack_id): """Get template content for a specific stack as a parsed JSON object. |