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

def get_credential ( tenant_id , credential_id ) : session = db . get_session ( ) try : cred = session . query ( l2network_models . Credential ) . filter_by ( tenant_id = tenant_id ) . filter_by ( credential_id = credential_id ) . one ( ) return cred except exc . NoResultFound : raise c_exc . CredentialNotFound ( credential_id = credential_id , tenant_id = tenant_id )
lists the creds for given a cred_id and tenant_id .