marvin_refactor: update the object during non-create transforms When an entity is updated/ the object attributes should be updated. Previously we only updated the attributes when creating the entity.
Signed-off-by: Prasanna Santhanam <t...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8a816e5d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8a816e5d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8a816e5d Branch: refs/heads/marvin_refactor Commit: 8a816e5d19f1abf3fcdf0e83381ea66f17ca381d Parents: 0fdc4e2 Author: Prasanna Santhanam <t...@apache.org> Authored: Fri Sep 13 15:57:05 2013 +0530 Committer: Prasanna Santhanam <t...@apache.org> Committed: Thu Oct 31 13:54:24 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/generate/entity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a816e5d/tools/marvin/marvin/generate/entity.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/generate/entity.py b/tools/marvin/marvin/generate/entity.py index dc96a14..b9f825b 100644 --- a/tools/marvin/marvin/generate/entity.py +++ b/tools/marvin/marvin/generate/entity.py @@ -90,7 +90,7 @@ class Entity(object): 'if %s and len(%s) > 0 else None' % ( entity, entity.lower(), entity.lower(), entity.lower())) else: - m.body.append(self.tabspace + 'return %s if %s else None' % (entity.lower(), entity.lower())) + m.body.append(self.tabspace + 'return self.__update__(%s.__dict__) if %s else None' % (entity.lower(), entity.lower())) else: if len(details['args']) > 0: #has required arguments m.signature = 'def __init__(self, apiclient=None, %s, factory=None, **kwargs):' % (