Source:
private EventResult runConnectHostToPoolEvent(final Guid storagePoolId, final VDS vds) { EventResult result = new EventResult(true, EventType.VDSCONNECTTOPOOL); StoragePool storagePool = getStoragePoolDAO().get(storagePoolId); StorageDomain masterDomain = getStorageDomainDAO().getStorageDomainByTypeAndPool(storagePoolId, StorageDomainType.Master); List<StoragePoolIsoMap> storagePoolIsoMap = getStoragePoolIsoMapDAO().getAllForStoragePool(storagePoolId); boolean masterDomainInactiveOrUnknown = masterDomain.getStatus() == StorageDomainStatus.Inactive || masterDomain.getStatus() == StorageDomainStatus.Unknown; VDSError error = null; try { VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters( vds, storagePool, masterDomain.getId(), storagePoolIsoMap)); if (!vdsReturnValue.getSucceeded()) { error = vdsReturnValue.getVdsError(); } } catch (VdcBLLException e) { error = e.getVdsError(); } if (error != null) { if (error.getCode() != VdcBllErrors.CannotConnectMultiplePools && masterDomainInactiveOrUnknown) { log.info("Could not connect host '{}' to pool '{}', as the master domain is in inactive/unknown" + " status - not failing the operation", vds.getName(), storagePool.getName()); } else { log.error("Could not connect host '{}' to pool '{}' with the message: {}", vds.getName(), storagePool.getName(), error.getMessage()); result.setSuccess(false); } } if (result.isSuccess()) { Pair<Boolean, List<StorageDomainStatic>> vdsStatsResults = proceedVdsStats(!masterDomainInactiveOrUnknown); result.setSuccess(vdsStatsResults.getFirst()); if (!result.isSuccess()) { result.setResultData(vdsStatsResults.getSecond()); AuditLogDirector.log(new AuditLogableBase(getVdsId()), AuditLogType.VDS_STORAGE_VDS_STATS_FAILED); } } return result; }

Target:
private EventResult runConnectHostToPoolEvent(final Guid storagePoolId, final VDS vds) { EventResult result = new EventResult(true, EventType.VDSCONNECTTOPOOL); StoragePool storagePool = getStoragePoolDAO().get(storagePoolId); StorageDomain masterDomain = getStorageDomainDAO().getStorageDomainByTypeAndPool(storagePoolId, StorageDomainType.Master); List<StoragePoolIsoMap> storagePoolIsoMap = getStoragePoolIsoMapDAO().getAllForStoragePool(storagePoolId); boolean masterDomainInactiveOrUnknown = masterDomain.getStatus() == StorageDomainStatus.Inactive || masterDomain.getStatus() == StorageDomainStatus.Unknown; VDSError error = null; try { VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters( vds, storagePool, masterDomain.getId(), storagePoolIsoMap)); if (!vdsReturnValue.getSucceeded()) { error = vdsReturnValue.getVdsError(); } } catch (VdcBLLException e) { error = e.getVdsError(); } if (error != null) { if (error.getCode() != VdcBllErrors.CannotConnectMultiplePools && masterDomainInactiveOrUnknown) { log.info("Could not connect host '{}' to pool '{}', as the master domain is in inactive/unknown" + " status - not failing the operation", vds.getName(), storagePool.getName()); } else { log.error("Could not connect host '{}' to pool '{}': {}", vds.getName(), storagePool.getName(), error.getMessage()); result.setSuccess(false); } } if (result.isSuccess()) { Pair<Boolean, List<StorageDomainStatic>> vdsStatsResults = proceedVdsStats(!masterDomainInactiveOrUnknown); result.setSuccess(vdsStatsResults.getFirst()); if (!result.isSuccess()) { result.setResultData(vdsStatsResults.getSecond()); AuditLogDirector.log(new AuditLogableBase(getVdsId()), AuditLogType.VDS_STORAGE_VDS_STATS_FAILED); } } return result; }