Source:
protected boolean canDoAction() { if (!checkStoragePool()) { return false; } if (!StringUtils.equals(getOldStoragePool().getName(), getStoragePool().getName()) && !isStoragePoolUnique(getStoragePool().getName())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NAME_ALREADY_EXIST); return false; } if ( getOldStoragePool().isLocal() != getStoragePool().isLocal() && getStorageDomainStaticDAO().getAllForStoragePool(getStoragePool().getId()).size() > 0) { getReturnValue().getCanDoActionMessages() .add(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_DOMAINS .toString()); return false; } if (!checkStoragePoolNameLengthValid()) { return false; } if ( !getOldStoragePool().getcompatibility_version().equals(getStoragePool() .getcompatibility_version())) { if (!isStoragePoolVersionSupported()) { addCanDoActionMessage(VersionSupport.getUnsupportedVersionMessage()); return false; } else if (getStoragePool().getcompatibility_version().compareTo(getOldStoragePool().getcompatibility_version()) < 0) { List<Network> networks = getNetworkDAO().getAllForDataCenter(getStoragePoolId()); if (networks.size() == 1) { Network network = networks.get(0); NetworkValidator validator = getNetworkValidator(network); validator.setDataCenter(getStoragePool()); if (!NetworkUtils.isManagementNetwork(network) || !validator.canNetworkCompatabilityBeDecreased()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); return false; } } else if (networks.size() > 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); return false; } } else { if (!checkAllClustersLevel()) { return false; } } } StoragePoolValidator validator = createStoragePoolValidator(); return validate(validator.isNotLocalfsWithDefaultCluster()); }

Target:
protected boolean canDoAction() { if (!checkStoragePool()) { return false; } if (!StringUtils.equals(getOldStoragePool().getName(), getStoragePool().getName()) && !isStoragePoolUnique(getStoragePool().getName())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NAME_ALREADY_EXIST); } List<StorageDomainStatic> poolDomains = getStorageDomainStaticDAO().getAllForStoragePool(getStoragePool().getId()); if ( getOldStoragePool().isLocal() != getStoragePool().isLocal() && !poolDomains.isEmpty() ) { return failCanDoAction(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_DOMAINS); } if (!checkStoragePoolNameLengthValid()) { return false; } if ( !getOldStoragePool().getcompatibility_version().equals(getStoragePool() .getcompatibility_version())) { if (!isStoragePoolVersionSupported()) { return failCanDoAction(VersionSupport.getUnsupportedVersionMessage()); } else if (getStoragePool().getcompatibility_version().compareTo(getOldStoragePool().getcompatibility_version()) < 0) { List<Network> networks = getNetworkDAO().getAllForDataCenter(getStoragePoolId()); if (networks.size() == 1) { Network network = networks.get(0); NetworkValidator validator = getNetworkValidator(network); validator.setDataCenter(getStoragePool()); if (!NetworkUtils.isManagementNetwork(network) || !validator.canNetworkCompatabilityBeDecreased()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); } } else if (networks.size() > 1) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION); } } else { if (!checkAllClustersLevel()) { return false; } } } StoragePoolValidator validator = createStoragePoolValidator(); return validate(validator.isNotLocalfsWithDefaultCluster()); }