cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [90/90] [abbrv] git commit: updated refs/heads/marvin_refactor to 26ea081
Date Wed, 08 May 2013 12:00:59 GMT
If there are no required arguments

the else block isn't required.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/26ea0811
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/26ea0811
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/26ea0811

Branch: refs/heads/marvin_refactor
Commit: 26ea08112a63efa2a02bdb1e260f756341fd9bd1
Parents: bf67e58
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Wed May 8 17:28:25 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed May 8 17:28:25 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/cs_entity_generator.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26ea0811/tools/marvin/marvin/cs_entity_generator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cs_entity_generator.py b/tools/marvin/marvin/cs_entity_generator.py
index 3bf3169..06076f9 100644
--- a/tools/marvin/marvin/cs_entity_generator.py
+++ b/tools/marvin/marvin/cs_entity_generator.py
@@ -243,9 +243,10 @@ def write_entity_classes(entities, module=None):
                 body.append(tabspace * 2 + 'if factory:')
                 body.append(
                     tabspace * 3 + '[setattr(cmd, factoryKey, factoryValue) for factoryKey,
factoryValue in factory.__dict__.iteritems()]')
-                body.append(tabspace * 2 + 'else:')
-                for arg in details["args"]:
-                    body.append(tabspace * 3 + "cmd.%s = %s" % (arg, arg))
+                if len(details["args"]) > 0:
+                    body.append(tabspace * 2 + 'else:')
+                    for arg in details["args"]:
+                        body.append(tabspace * 3 + "cmd.%s = %s" % (arg, arg))
                 body.append(tabspace * 2 + '[setattr(cmd, key, value) for key, value in kwargs.iteritems()]')
                 body.append(tabspace * 2 + '%s = apiclient.%s(cmd)' % (entity.lower(), details['apimodule']))
                 body.append(


Mime
View raw message