You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2013/07/28 13:04:38 UTC

[2/3] git commit: cloudmonkey: Simplify missing parameter check

cloudmonkey: Simplify missing parameter check

This simplifies Carson Anderson's previous patch. We simply split by [ and take
the first element, if [ was not present we get the string/key itself.

Signed-off-by: Rohit Yadav <bh...@apache.org>


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

Branch: refs/heads/master
Commit: 9a6b5a99978a21410b1e5dc61d2c33e973a2f4b0
Parents: 924554f
Author: Rohit Yadav <bh...@apache.org>
Authored: Sun Jul 28 16:32:33 2013 +0530
Committer: Rohit Yadav <bh...@apache.org>
Committed: Sun Jul 28 16:32:33 2013 +0530

----------------------------------------------------------------------
 cloudmonkey/cloudmonkey.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/9a6b5a99/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index ead939c..b465bec 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -288,7 +288,8 @@ class CloudMonkeyShell(cmd.Cmd, object):
 
         missing = []
         if verb in self.apicache and subject in self.apicache[verb]:
-            missing = filter(lambda x: x not in args_dict.keys() + [parm.split('[')[0] for parm in args_dict.keys()],
+            missing = filter(lambda x: x not in [key.split('[')[0]
+                                                 for key in args_dict],
                              self.apicache[verb][subject]['requiredparams'])
 
         if len(missing) > 0: