X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fclient%2Fsfi.py;h=8cc89033d9fd4dcf07fa43247fc54aa9beec270c;hb=4ba188d2e00ad2ecb5d642c6c442fef500539752;hp=4b5eacb3718143e1b6a0032c6579d9a267802316;hpb=a4f50d368b152a8836194cc3623e8a9c98d90ea6;p=sfa.git diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 4b5eacb3..8cc89033 100644 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -218,7 +218,7 @@ def render_plural (how_many, name,names=None): if not names: names="%ss"%name if how_many<=0: return "No %s"%name elif how_many==1: return "1 %s"%name - else return "%d %s"%(how_many,names) + else: return "%d %s"%(how_many,names) def terminal_render_default (record,options): print "%s (%s)" % (record['hrn'], record['type']) @@ -228,8 +228,7 @@ def terminal_render_user (record, options): if record.get('reg-slices',None): print " [IN slices %s]"%(" and ".join(record['reg-slices'])), user_keys=record.get('reg-keys',[]) if not options.verbose: - print " [has %s]"%(render_plural(len(user_keys),"name")) - print "" + print " [has %s]"%(render_plural(len(user_keys),"key")) else: print "" for key in user_keys: print 8*' ',key.strip("\n") @@ -468,7 +467,7 @@ class Sfi: parser.add_option("-r", "--recursive", dest="recursive", action='store_true', help="list all child records", default=False) parser.add_option("-v", "--verbose", dest="verbose", action='store_true', - help="more verbose", default=False) + help="gives details, like user keys", default=False) if command in ("delegate"): parser.add_option("-u", "--user", action="store_true", dest="delegate_user", default=False, @@ -1155,7 +1154,8 @@ or with an slice hrn, shows currently provisioned resources # xxx Thierry 2012 sept. 21 # contrary to what I was first thinking, calling Resolve with details=False does not yet work properly here # I am turning details=True on again on a - hopefully - temporary basis, just to get this whole thing to work again - slice_records = self.registry().Resolve(slice_urn, [self.my_credential_string], {'details':True}) + slice_records = self.registry().Resolve(slice_urn, [self.my_credential_string]) + # slice_records = self.registry().Resolve(slice_urn, [self.my_credential_string], {'details':True}) if slice_records and 'reg-researchers' in slice_records[0] and slice_records[0]['reg-researchers']: slice_record = slice_records[0] user_hrns = slice_record['reg-researchers'] @@ -1450,7 +1450,8 @@ or with an slice hrn, shows currently provisioned resources self.print_help() sys.exit(1) target_hrn = args[0] - gid = self.registry().CreateGid(self.my_credential_string, target_hrn, self.client_bootstrap.my_gid_string()) + my_gid_string = open(self.client_bootstrap.my_gid()).read() + gid = self.registry().CreateGid(self.my_credential_string, target_hrn, my_gid_string) if options.file: filename = options.file else: