def _check_ldev(ldev_info, ldev, existing_ref):
 if (ldev_info['sts'] != NORMAL_STS):
  msg = utils.output_log(MSG.INVALID_LDEV_FOR_MANAGE)
  raise exception.ManageExistingInvalidReference(existing_ref=existing_ref, reason=msg)
 vol_attr = set(ldev_info['vol_attr'])
 if ((not ldev_info['vol_type'].startswith('OPEN-V')) or (len(vol_attr) < 2) or (not vol_attr.issubset(_PERMITTED_TYPES))):
  msg = utils.output_log(MSG.INVALID_LDEV_ATTR_FOR_MANAGE, ldev=ldev, ldevtype=utils.NVOL_LDEV_TYPE)
  raise exception.ManageExistingInvalidReference(existing_ref=existing_ref, reason=msg)
 if (ldev_info['vol_size'] % utils.GIGABYTE_PER_BLOCK_SIZE):
  msg = utils.output_log(MSG.INVALID_LDEV_SIZE_FOR_MANAGE, ldev=ldev)
  raise exception.ManageExistingInvalidReference(existing_ref=existing_ref, reason=msg)
 if ldev_info['num_port']:
  msg = utils.output_log(MSG.INVALID_LDEV_PORT_FOR_MANAGE, ldev=ldev)
  raise exception.ManageExistingInvalidReference(existing_ref=existing_ref, reason=msg)

def _check_ldev ( ldev_info , ldev , existing_ref ) : if ( ldev_info [ 'sts' ] != NORMAL_STS ) : msg = utils . output_log ( MSG . INVALID_LDEV_FOR_MANAGE ) raise exception . ManageExistingInvalidReference ( existing_ref = existing_ref , reason = msg ) vol_attr = set ( ldev_info [ 'vol_attr' ] ) if ( ( not ldev_info [ 'vol_type' ] . startswith ( 'OPEN-V' ) ) or ( len ( vol_attr ) < 2 ) or ( not vol_attr . issubset ( _PERMITTED_TYPES ) ) ) : msg = utils . output_log ( MSG . INVALID_LDEV_ATTR_FOR_MANAGE , ldev = ldev , ldevtype = utils . NVOL_LDEV_TYPE ) raise exception . ManageExistingInvalidReference ( existing_ref = existing_ref , reason = msg ) if ( ldev_info [ 'vol_size' ] % utils . GIGABYTE_PER_BLOCK_SIZE ) : msg = utils . output_log ( MSG . INVALID_LDEV_SIZE_FOR_MANAGE , ldev = ldev ) raise exception . ManageExistingInvalidReference ( existing_ref = existing_ref , reason = msg ) if ldev_info [ 'num_port' ] : msg = utils . output_log ( MSG . INVALID_LDEV_PORT_FOR_MANAGE , ldev = ldev ) raise exception . ManageExistingInvalidReference ( existing_ref = existing_ref , reason = msg )
check if the ldev meets the criteria for being managed by the driver .