summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorAdrian Likins <alikins@grimlock.devel.redhat.com>2008-04-08 18:34:19 -0400
committerAdrian Likins <alikins@grimlock.devel.redhat.com>2008-04-08 18:34:19 -0400
commit8cf7662a1f7710dad36b32a686f00a9d3c9dbf10 (patch)
tree410628d8a172110197600f1d2935e50dc7689404 /func
parent67503262b3f9226dc139822991b3b0b9b856d7b1 (diff)
downloadthird_party-func-8cf7662a1f7710dad36b32a686f00a9d3c9dbf10.tar.gz
third_party-func-8cf7662a1f7710dad36b32a686f00a9d3c9dbf10.tar.xz
third_party-func-8cf7662a1f7710dad36b32a686f00a9d3c9dbf10.zip
add "--pickle" support for dumping call data in python pickle format.
Diffstat (limited to 'func')
-rw-r--r--func/overlord/cmd_modules/call.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py
index b92d3ab..5ad1f26 100644
--- a/func/overlord/cmd_modules/call.py
+++ b/func/overlord/cmd_modules/call.py
@@ -37,6 +37,9 @@ class Call(base_command.BaseCommand):
self.parser.add_option("-j", "--json", dest="json",
help="output return data using JSON",
action="store_true")
+ self.parser.add_option("-p", "--pickle", dest="pickle",
+ help="output return data in python pickle format",
+ action="store_true")
self.parser.add_option("-f", "--forks", dest="forks",
help="how many parallel processes? (default 1)",
default=DEFAULT_FORKS)
@@ -65,7 +68,6 @@ class Call(base_command.BaseCommand):
if self.options.json:
try:
import simplejson
- print "blargh\n\n"
return simplejson.dumps(data)
except ImportError:
print "WARNING: json support not found, install python-simplejson"
@@ -74,6 +76,9 @@ class Call(base_command.BaseCommand):
if self.options.rawprint:
return data
+ if self.options.pickle:
+ import pickle
+ return pickle.dumps(data)
return pprint.pformat(data)