rename get_summary_tostring into pretty_cred
[sfa.git] / sfa / client / sfi.py
index 7dc7ee0..3699d55 100644 (file)
@@ -96,14 +96,14 @@ def filter_records(type, records):
 
 
 def credential_printable (cred):
-    credential=Credential(cred=cred)
+    credential = Credential(cred=cred)
     result=""
-    result += credential.get_summary_tostring()
+    result += credential.pretty_cred()
     result += "\n"
     rights = credential.get_privileges()
     result += "type=%s\n" % credential.type    
     result += "version=%s\n" % credential.version    
-    result += "rights=%s\n"%rights
+    result += "rights=%s\n" % rights
     return result
 
 def show_credentials (cred_s):
@@ -201,7 +201,7 @@ def load_record_from_opts(options):
             pubkey = options.key
         if not check_ssh_key (pubkey):
             raise SfaInvalidArgument(name='key',msg="Could not find file, or wrong key format")
-        record_dict['keys'] = [pubkey]
+        record_dict['reg-keys'] = [pubkey]
     if hasattr(options, 'slices') and options.slices:
         record_dict['slices'] = options.slices
     if hasattr(options, 'reg_researchers') and options.reg_researchers is not None:
@@ -674,6 +674,8 @@ use this if you mean an authority instead""")
     
     # init self-signed cert, user credentials and gid
     def bootstrap (self):
+        if self.options.verbose:
+            self.logger.info("Initializing SfaClientBootstrap with {}".format(self.reg_url))
         client_bootstrap = SfaClientBootstrap (self.user, self.reg_url, self.options.sfi_dir,
                                                logger=self.logger)
         # if -k is provided, use this to initialize private key
@@ -1103,7 +1105,10 @@ use this if you mean an authority instead""")
         if options.show_credential:
             show_credentials(auth_cred)
         remove = self.registry().Remove(hrn, auth_cred, type)
-        return self.success (remove)
+        # xxx looks like the result here is not ReturnValue-compatible
+        #return self.success (remove)
+        # xxx should analyze result
+        return 0
     
     # ==================================================================
     # Slice-related commands