heat-keystone-setup-domain should be idempotent

Bug #1435415 reported by Zane Bitter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Michal Rostecki

Bug Description

Running heat-keystone-setup-domain twice causes errors. It should handle the case where some of the things it is trying to add already exist.

[root@rhos6-storage-1 ~(keystone_admin)]# heat-keystone-setup-domain --insecure --stack-domain-admin heat_admin --stack-domain-admin-password rh0s6 --stack-user-domain-name heat
WARNING (heat-keystone-setup-domain:107) Domain heat already exists
WARNING (heat-keystone-setup-domain:131) User heat_admin already exists
Traceback (most recent call last):
  File "/usr/bin/heat-keystone-setup-domain", line 148, in <module>
    main()
  File "/usr/bin/heat-keystone-setup-domain", line 132, in main
    domain_admin = c.users.list(name=HEAT_DOMAIN_ADMIN)[0]
  File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/v3/users.py", line 107, in list
    **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 71, in func
    return f(*args, **new_kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 352, in list
    self.collection_key)
  File "/usr/lib/python2.7/site-packages/keystoneclient/base.py", line 112, in _list
    resp, body = self.client.get(url, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/httpclient.py", line 629, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/httpclient.py", line 621, in _cs_request
    return self.request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/httpclient.py", line 596, in request
    resp = super(HTTPClient, self).request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/baseclient.py", line 21, in request
    return self.session.request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/keystoneclient/session.py", line 346, in request
    raise exceptions.from_response(resp, method, url)
keystoneclient.openstack.common.apiclient.exceptions.Unauthorized: The request you have made requires authentication. (HTTP 401)

Zane Bitter (zaneb)
Changed in heat:
importance: Undecided → Medium
description: updated
Changed in heat:
assignee: nobody → Michal Rostecki (mrostecki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/167199

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/167199
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=501ae172d05c58654bc0c988bc0277a866c235d9
Submitter: Jenkins
Branch: master

commit 501ae172d05c58654bc0c988bc0277a866c235d9
Author: Michal Rostecki <email address hidden>
Date: Tue Mar 24 12:26:11 2015 +0000

    Using OS_TENANT_NAME in heat-keystone-setup-domain

    Tenant name was not provided in Keystone client, so it was not
    authenticated properly and raised Unauthorized exception.

    Change-Id: I0b86ffa3eeff4a9631e36f56f4e111bb5eadf8b6
    Closes-Bug: #1435415

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.