update failed if no difference in properties Keystone::User

Bug #1565742 reported by Peter Razumovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Peter Razumovsky

Bug Description

If I try to update Keystone::User resource without any changing properties, next error raised:

2016-04-04 14:18:57.675 INFO heat.engine.resource [-] UPDATE: KeystoneUser "user" [61fe9716d0954083a6ebe9a47da80641] Stack "user" [8183ed66-e873-4eda-9310-91269ca42dd7]
2016-04-04 14:18:57.675 TRACE heat.engine.resource Traceback (most recent call last):
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 704, in _action_recorder
2016-04-04 14:18:57.675 TRACE heat.engine.resource yield
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 1154, in update
2016-04-04 14:18:57.675 TRACE heat.engine.resource prop_diff])
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 297, in wrapper
2016-04-04 14:18:57.675 TRACE heat.engine.resource step = next(subtask)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 747, in action_handler_task
2016-04-04 14:18:57.675 TRACE heat.engine.resource handler_data = handler(*args)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/keystone/user.py", line 225, in handle_update
2016-04-04 14:18:57.675 TRACE heat.engine.resource new_password=password
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/keystone/user.py", line 139, in _update_user
2016-04-04 14:18:57.675 TRACE heat.engine.resource return self.client().users.update(**values)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/debtcollector/renames.py", line 45, in wrapper
2016-04-04 14:18:57.675 TRACE heat.engine.resource return f(*args, **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
2016-04-04 14:18:57.675 TRACE heat.engine.resource return func(*args, **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneclient/v3/users.py", line 146, in update
2016-04-04 14:18:57.675 TRACE heat.engine.resource log=False)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneclient/base.py", line 225, in _update
2016-04-04 14:18:57.675 TRACE heat.engine.resource **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 185, in patch
2016-04-04 14:18:57.675 TRACE heat.engine.resource return self.request(url, 'PATCH', **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 331, in request
2016-04-04 14:18:57.675 TRACE heat.engine.resource resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 98, in request
2016-04-04 14:18:57.675 TRACE heat.engine.resource return self.session.request(url, method, **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 94, in inner
2016-04-04 14:18:57.675 TRACE heat.engine.resource return func(*args, **kwargs)
2016-04-04 14:18:57.675 TRACE heat.engine.resource File "/usr/local/lib/python2.7/dist-packages/keystoneclient/session.py", line 420, in request
2016-04-04 14:18:57.675 TRACE heat.engine.resource raise exceptions.from_response(resp, method, url)
2016-04-04 14:18:57.675 TRACE heat.engine.resource BadRequest: {} does not have enough properties (HTTP 400) (Request-ID: req-d178485a-beb1-4a97-812f-2c2dff6c9ac3)

Need to check that we do not pass empty values to users.update method.

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/301059

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/301059
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=802f42f9166e8befb567df2a5599a187d45d28fe
Submitter: Jenkins
Branch: master

commit 802f42f9166e8befb567df2a5599a187d45d28fe
Author: Peter Razumovsky <email address hidden>
Date: Mon Apr 4 14:34:48 2016 +0300

    Keystone::User: do not update if no changes

    If user.update called with no args, keystone raises
    BadRequest exception with message that there're not
    enough parameters for updating. So return from method
    to prevent error raising.

    Change-Id: Ia04419de32f5055b9096f3c16c7aba2eb060a4c8
    Closes-bug: #1565742

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 7.0.0.0b1

This issue was fixed in the openstack/heat 7.0.0.0b1 development milestone.

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.