Revert "Don't update tags every time"

This reverts commit e77322c179.

Change-Id: Ida826a2aa888beeb76dbe657b2ccd6cb088157ed
This commit is contained in:
Steve Martinelli
2016-08-19 06:10:14 +00:00
parent e77322c179
commit b78285761d
2 changed files with 6 additions and 34 deletions
+6 -3
View File
@@ -31,12 +31,12 @@ class SchemaBasedModel(warlock.Model):
"""
def _make_custom_patch(self, new, original):
if 'tags' in new and 'tags' not in original:
if not self.get('tags'):
tags_patch = []
else:
tags_patch = [{"path": "/tags",
"value": self.get('tags'),
"op": "replace"}]
else:
tags_patch = []
patch_string = jsonpatch.make_patch(original, new).to_string()
patch = json.loads(patch_string)
@@ -55,6 +55,9 @@ class SchemaBasedModel(warlock.Model):
if (name not in original and name in new and
prop.get('is_base', True)):
original[name] = None
original['tags'] = None
new['tags'] = None
return self._make_custom_patch(new, original)