def get_credential_name(tenant_id, credential_name):
 session = db.get_session()
 try:
  cred = session.query(l2network_models.Credential).filter_by(tenant_id=tenant_id).filter_by(credential_name=credential_name).one()
  return cred
 except exc.NoResultFound:
  raise c_exc.CredentialNameNotFound(credential_name=credential_name, tenant_id=tenant_id)

def get_credential_name ( tenant_id , credential_name ) : session = db . get_session ( ) try : cred = session . query ( l2network_models . Credential ) . filter_by ( tenant_id = tenant_id ) . filter_by ( credential_name = credential_name ) . one ( ) return cred except exc . NoResultFound : raise c_exc . CredentialNameNotFound ( credential_name = credential_name , tenant_id = tenant_id )
lists the creds for given a cred_name and tenant_id .