cli: Get rid of deprecated sets, go functional, use filter()

Signed-off-by: Rohit Yadav <[email protected]>


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

Branch: refs/heads/ui-plugins
Commit: 503a5f2ccd773ab23358a662bac1bc9fc08a0d1f
Parents: 67f9467
Author: Rohit Yadav <[email protected]>
Authored: Fri Dec 21 11:20:40 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Fri Dec 21 11:21:22 2012 -0800

----------------------------------------------------------------------
 tools/cli/cloudmonkey/cloudmonkey.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/503a5f2c/tools/cli/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/tools/cli/cloudmonkey/cloudmonkey.py 
b/tools/cli/cloudmonkey/cloudmonkey.py
index e4fe76f..edb62cc 100644
--- a/tools/cli/cloudmonkey/cloudmonkey.py
+++ b/tools/cli/cloudmonkey/cloudmonkey.py
@@ -26,7 +26,6 @@ try:
     import logging
     import os
     import pdb
-    import sets
     import shlex
     import sys
     import time
@@ -332,8 +331,8 @@ class CloudMonkeyShell(cmd.Cmd, object):
             setattr(api_cmd, attribute, args_dict[attribute])
 
         command = api_cmd()
-        missing_args = list(sets.Set(command.required).difference(
-                            sets.Set(args_dict.keys())))
+        missing_args = filter(lambda x: x not in args_dict.keys(),
+                              command.required)
 
         if len(missing_args) > 0:
             self.print_shell("Missing arguments:", ' '.join(missing_args))

Reply via email to