From da3bb9a7ec03ca5879878c056f6d1abf26ccc303 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 8 Sep 2011 13:54:39 +0200 Subject: [PATCH] add a -o/--ouput option to the create command as well --- sfa/client/sfi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.47.0