def remove_credential(tenant_id, credential_id):
 session = db.get_session()
 try:
  cred = session.query(network_models_v2.Credential).filter_by(tenant_id=tenant_id).filter_by(credential_id=credential_id).one()
  session.delete(cred)
  session.flush()
  return cred
 except exc.NoResultFound:
  pass

def remove_credential ( tenant_id , credential_id ) : session = db . get_session ( ) try : cred = session . query ( network_models_v2 . Credential ) . filter_by ( tenant_id = tenant_id ) . filter_by ( credential_id = credential_id ) . one ( ) session . delete ( cred ) session . flush ( ) return cred except exc . NoResultFound : pass
removes a credential from a tenant .