From: Thierry Parmentelat Date: Thu, 8 Sep 2011 11:54:39 +0000 (+0200) Subject: add a -o/--ouput option to the create command as well X-Git-Tag: sfa-1.0-36~19 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=da3bb9a7ec03ca5879878c056f6d1abf26ccc303;p=sfa.git add a -o/--ouput option to the create command as well --- diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 293e5bdd..63883482 100755 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -226,7 +226,8 @@ class Sfi: help="optional component information", default=None) - if command in ("resources", "show", "list", "create_gid"): + # 'create' does return the new rspec, makes sense to save that too + if command in ("resources", "show", "list", "create_gid", 'create'): parser.add_option("-o", "--output", dest="file", help="output XML to file", metavar="FILE", default=None) @@ -1005,7 +1006,10 @@ class Sfi: call_args.append(unique_call_id()) result = server.CreateSliver(*call_args) - print result + if opts.file is None: + print result + else: + save_rspec_to_file (result, opts.file) return result # get a ticket for the specified slice