Fix that remove 'strategy' attribute does not work.

The 'strategy_id' attribute is the one that not exposes
to API. But the 'PATCH' API always update this attribute.
So this change does not work when choose 'remove' op.
This patch sets value for 'strategy_id' attribute.

Change-Id: I1597fb5d4985bb8271ad3cea7ea5f0adb7de65f4
Closes-Bug: #1662395
This commit is contained in:
ericxiett 2017-02-08 09:25:58 +08:00
parent 8ceb710b59
commit e55c73be0e
1 changed files with 1 additions and 0 deletions

View File

@ -333,6 +333,7 @@ class AuditTemplate(base.APIBase):
self.fields.append('goal_id')
self.fields.append('strategy_id')
setattr(self, 'strategy_id', kwargs.get('strategy_id', wtypes.Unset))
# goal_uuid & strategy_uuid are not part of
# objects.AuditTemplate.fields because they're API-only attributes.