+ """
+ Get our credential from a remote registry using a geniclient connection
+ """
+ type = 'sa'
+ cred_filename = ".".join([self.server_basedir, self.interface, self.hrn, type, "cred"])
+ try:
+ credential = Credential(filename = cred_filename)
+ return credential
+ except IOError:
+ from geni.util.registry import Registries
+ registries = Registries()
+ registry = registries[self.hrn]
+ self_cred = registry.get_credential(None, type, self.hrn)
+ cred = registry.get_credential(self_cred, type, self.hrn)
+ cred.save_to_file(cred_filename, save_parents=True)
+
+ def getCredentialFromLocalRegistry(self):