- # Validate that at least one of the credentials is good enough
- found = False
- for cred in creds:
- try:
- self.api.auth.check(cred, 'listnodes')
- found = True
- user_cred = Credential(string=cred)
- break
- except:
- error = sys.exc_info()[:2]
- continue
+ # Find the valid credentials
+ hrn = None
+ if options.has_key('geni_slice_urn'):
+ xrn = options['geni_slice_urn']
+ hrn, _ = urn_to_hrn(xrn)
+
+ ValidCreds = self.api.auth.checkCredentials(creds, 'listnodes', hrn)
+ origin_hrn = Credential(string=ValidCreds[0]).get_gid_caller().get_hrn()