summaryrefslogtreecommitdiff
path: root/heatclient/v1/stacks.py
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2013-12-02 22:50:15 +0000
committerSteven Hardy <shardy@redhat.com>2013-12-03 14:41:45 +0000
commite259163d5632188065b2ad4bbb2065d4fd5fc91d (patch)
treebe0a6c8c98edd09aabd145c691ed301d6aff8475 /heatclient/v1/stacks.py
parentb0b085dfb380d455470534dcee3c3e99c980df45 (diff)
downloadpython-heatclient-e259163d5632188065b2ad4bbb2065d4fd5fc91d.tar.gz
Revert "Don't call credentials_headers() twice"
When we create or update a stack, when deferred_auth_method=password (which is the default in heat.conf), the client must pass the username and password, even if they don't need to for authentication (ie they're passing a token). Otherwise there's no username and password in the context to store, and the engine validation in heat/engine/service.py::_validate_deferred_auth_context fails. No such issue exists when deferred_auth_method=trusts, which is why this problem was missed during testing of the patch being reverted. Note some fixup in addition to the revert was required to make the tests pass, as ShellTestToken and ShellTestStandaloneToken now require username/password set in the fake env. This reverts commit a7ba3c323b16227e0ba2527f21bc89625f125234 Change-Id: I0e7bc3f748022c2bf5ef7ef6dfe4d97953e3fcab
Diffstat (limited to 'heatclient/v1/stacks.py')
-rw-r--r--heatclient/v1/stacks.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py
index 5227117..90a78de 100644
--- a/heatclient/v1/stacks.py
+++ b/heatclient/v1/stacks.py
@@ -109,14 +109,16 @@ class StackManager(base.Manager):
def create(self, **kwargs):
"""Create a stack."""
+ headers = self.api.credentials_headers()
resp, body = self.api.json_request('POST', '/stacks',
- body=kwargs)
+ body=kwargs, headers=headers)
return body
def update(self, stack_id, **kwargs):
"""Update a stack."""
+ headers = self.api.credentials_headers()
resp, body = self.api.json_request('PUT', '/stacks/%s' % stack_id,
- body=kwargs)
+ body=kwargs, headers=headers)
def delete(self, stack_id):
"""Delete a stack."""