cloudmonkey: change signature to default to [] instead of None filter Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/a02b0038 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/a02b0038 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/a02b0038 Branch: refs/heads/master Commit: a02b0038a50602434f71f14a4e3ccc07e9ea9c80 Parents: 3c9f491 Author: Rohit Yadav <rohit.ya...@shapeblue.com> Authored: Mon Oct 6 14:08:47 2014 +0200 Committer: Rohit Yadav <rohit.ya...@shapeblue.com> Committed: Mon Oct 6 14:08:47 2014 +0200 ---------------------------------------------------------------------- cloudmonkey/cloudmonkey.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/a02b0038/cloudmonkey/cloudmonkey.py ---------------------------------------------------------------------- diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py index d5d8518..0275dce 100644 --- a/cloudmonkey/cloudmonkey.py +++ b/cloudmonkey/cloudmonkey.py @@ -186,7 +186,7 @@ class CloudMonkeyShell(cmd.Cmd, object): else: print output - def print_result(self, result, result_filter=None): + def print_result(self, result, result_filter=[]): if result is None or len(result) == 0: return @@ -248,7 +248,7 @@ class CloudMonkeyShell(cmd.Cmd, object): if printer: self.monkeyprint(printer) - def print_result_as_dict(result, result_filter=None): + def print_result_as_dict(result, result_filter=[]): if self.display == "json": print_result_json(result, result_filter) return @@ -270,7 +270,7 @@ class CloudMonkeyShell(cmd.Cmd, object): self.monkeyprint(key + ":") self.print_result(result[key], result_filter) - def print_result_as_list(result, result_filter=None): + def print_result_as_list(result, filter=[]): for node in result: if isinstance(node, dict) and self.display == 'table': print_result_tabular(result, result_filter)