Fix problem with update including id

The update includes the id which is obviously not a field that
can be updated.  I would imagine most services would ignore that,
but it probably isn't good policy.

Partial-bug: #1665495

Change-Id: I6c84b549dae53f91d1662f6e41ea632477c7652c
This commit is contained in:
Terry Howe 2017-02-21 09:20:54 -07:00
parent e7f7b400bb
commit d56535d4d3
1 changed files with 3 additions and 0 deletions

View File

@ -644,6 +644,9 @@ class Resource(object):
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_update` is not set to ``True``.
"""
# The id cannot be dirty for an update
self._body._dirty.discard("id")
# Only try to update if we actually have anything to update.
if not any([self._body.dirty, self._header.dirty]):
return self