X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fclient%2Fsfi.py;h=f16a234687e04215596f6051285eeb12f493e12b;hb=872ab6f6b720fac6dff888ba32a0ec73911827ee;hp=352701911f0e132db3a6956e66e0d3ae13df8f4d;hpb=e0e3b09aa39ec0f078cf007927bfd4e9573a1211;p=sfa.git diff --git a/sfa/client/sfi.py b/sfa/client/sfi.py index 35270191..f16a2346 100644 --- a/sfa/client/sfi.py +++ b/sfa/client/sfi.py @@ -221,7 +221,7 @@ def terminal_render_user (record, options): def terminal_render_slice (record, options): print "%s (Slice)"%record['hrn'], if record.get('reg-researchers',None): print " [USERS %s]"%(" and ".join(record['reg-researchers'])), - print record.keys() +# print record.keys() print "" def terminal_render_authority (record, options): print "%s (Authority)"%record['hrn'], @@ -521,7 +521,11 @@ class Sfi: # Main: parse arguments and dispatch to command # def dispatch(self, command, command_options, command_args): - return getattr(self, command)(command_options, command_args) + method=getattr(self, command,None) + if not method: + print "Unknown command %s"%command + return + return method(command_options, command_args) def main(self): self.sfi_parser = self.create_parser() @@ -556,8 +560,8 @@ class Sfi: try: self.dispatch(command, command_options, command_args) - except KeyError: - self.logger.critical ("Unknown command %s"%command) + except: + self.logger.log_exc ("sfi command %s failed"%command) sys.exit(1) return @@ -904,9 +908,8 @@ or version information about sfi itself self.print_help() sys.exit(1) hrn = args[0] - # xxx should set details=True here but that's not in the xmlrpc interface ... - # record_dicts = self.registry().Resolve(hrn, self.my_credential_string, details=True) - record_dicts = self.registry().Resolve(hrn, self.my_credential_string) + # explicitly require Resolve to run in details mode + record_dicts = self.registry().Resolve(hrn, self.my_credential_string, {'details':True}) record_dicts = filter_records(options.type, record_dicts) if not record_dicts: self.logger.error("No record of type %s"% options.type)