Moti Asayag has posted comments on this change. Change subject: engine: introducing RemoveVfsConfigLabelCommand ......................................................................
Patch Set 11: Code-Review-1 (4 comments) https://gerrit.ovirt.org/#/c/36847/11/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/RemoveVfsConfigLabelCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/RemoveVfsConfigLabelCommand.java: Line 24: } Line 25: Line 26: @Override Line 27: protected boolean canDoAction() { Line 28: if (super.canDoAction()) { can be replaced with a single return statement. Line 29: return validate(getVfsConfigValidator().labelInVfsConfig(getLabel())); Line 30: } Line 31: Line 32: return false; https://gerrit.ovirt.org/#/c/36847/11/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VfsConfigValidator.java: Line 147: */ Line 148: public ValidationResult labelInVfsConfig(String label) { Line 149: return ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG, Line 150: getNicNameReplacement(), String.format(LABEL_REPLACEMENT, label)) Line 151: .when(!oldVfsConfig.getLabels().contains(label)); instead of negating the condition you can use the 'unless(condition)' to check that you cannot remove the label unless it exists. Line 152: } Line 153: Line 154: Network getNetwork(Guid networkId) { Line 155: return getDbFacade().getNetworkDao().get(networkId); https://gerrit.ovirt.org/#/c/36847/11/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties File backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties: Line 548: ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG=Cannot ${action} ${type}. Network ${networkName} already exists in network interface ${nicName} VFs configuration. Line 549: ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG=Cannot ${action} ${type}. Network ${networkName} doesn't exist in network interface ${nicName} VFs configuration. Line 550: ACTION_TYPE_FAILED_NETWORK_NOT_EXIST=Cannot ${action} ${type}. Network with id ${networkId} doesn't exist. Line 551: ACTION_TYPE_FAILED_LABEL_ALREADY_IN_VFS_CONFIG=Cannot ${action} ${type}. Label ${label} already exists in network interface ${nicName} VFs configuration. Line 552: ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG=Cannot ${action} ${type}. Label ${label} doesn't exist in network interface ${nicName} VFs configuration. please add the host name Line 553: Line 554: ERROR_CANNOT_RECOVERY_STORAGE_POOL_THERE_IS_ACTIVE_DATA_DOMAINS=Cannot recover Data Center with active Data Storage Domain in Data Center. Line 555: ERROR_CANNOT_DETACH_LAST_STORAGE_DOMAIN=Cannot remove the master Storage Domain from the Data Center without another active Storage Domain to take its place.\n\ Line 556: -Either activate another Storage Domain in the Data Center, or remove the Data Center. https://gerrit.ovirt.org/#/c/36847/11/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties File backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties: Line 568: ADD_VFS_CONFIG_LABEL=Label ${Label} was added to the VFs configuration of network interface card ${NicName}. Line 569: ADD_VFS_CONFIG_LABEL_FAILED=Failed to add ${Label} to the VFs configuration of network interface card ${NicName}. Line 570: REMOVE_VFS_CONFIG_NETWORK=Network ${NetworkName} was removed from the VFs configuration of network interface card ${NicName}. Line 571: REMOVE_VFS_CONFIG_NETWORK_FAILED=Failed to remove ${NetworkName} from the VFs configuration of network interface card ${NicName}. Line 572: REMOVE_VFS_CONFIG_LABEL=Label ${Label} was removed from the VFs configuration of network interface card ${NicName}. please add the host name Line 573: REMOVE_VFS_CONFIG_LABEL_FAILED=Failed to remove ${Label} from the VFs configuration of network interface card ${NicName}. Line 574: SYSTEM_DEACTIVATED_STORAGE_DOMAIN=Storage Domain ${StorageDomainName} (Data Center ${StoragePoolName}) was deactivated by system because it's not visible by any of the hosts. Line 575: SYSTEM_DEACTIVATE_STORAGE_DOMAIN_FAILED=Failed to deactivate Storage Domain ${StorageDomainName} (Data Center ${StoragePoolName}). Line 576: VDS_SET_NONOPERATIONAL_DOMAIN=Host ${VdsName} cannot access the Storage Domain(s) ${StorageDomainNames} attached to the Data Center ${StoragePoolName}. Setting Host state to Non-Operational. -- To view, visit https://gerrit.ovirt.org/36847 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d6ddd73a5325fc972435b826cc45571d2db7e5c Gerrit-PatchSet: 11 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
