From: Thierry Parmentelat Date: Mon, 28 Apr 2014 15:45:16 +0000 (+0200) Subject: add a -n/--no-details option to sfi show; X-Git-Tag: sfa-3.1-4~23 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=e1aa0abb0224eec24bd9996150ebe277f697f898 add a -n/--no-details option to sfi show; when provided Resolve is called with details=False, so we really get only the registry's view --- diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index a77f258f..6438acd2 100644 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -451,6 +451,8 @@ class Sfi: if command in ("show"): parser.add_option("-k","--key",dest="keys",action="append",default=[], help="specify specific keys to be displayed from record") + parser.add_option("-n","--no-details",dest="no_details",action="store_true",default=False, + help="call Resolve without the 'details' option") if command in ("resources", "describe"): # rspec version parser.add_option("-r", "--rspec-version", dest="rspec_version", default="GENI 3", @@ -947,7 +949,9 @@ use this if you mean an authority instead""") sys.exit(1) hrn = args[0] # explicitly require Resolve to run in details mode - record_dicts = self.registry().Resolve(hrn, self.my_credential_string, {'details':True}) + resolve_options={} + if not options.no_details: resolve_options['details']=True + record_dicts = self.registry().Resolve(hrn, self.my_credential_string, resolve_options) record_dicts = filter_records(options.type, record_dicts) if not record_dicts: self.logger.error("No record of type %s"% options.type)