Yair Zaslavsky has uploaded a new change for review. Change subject: core: Preventing host activation when host is non responsive ......................................................................
core: Preventing host activation when host is non responsive The following introduces proper error messages + logic to the VdsValidator to prevent non responsive host from being activated Bug-Url: https://bugzilla.redhat.com/669475 Change-Id: I02846c6e1bc780f5b80a9e99c167f49d24c6bc57 Signed-off-by: Yair Zaslavsky <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 6 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/50/16650/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java index 8ac0687..8423cab 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsValidator.java @@ -58,6 +58,9 @@ if (vds.getStatus().equals(VDSStatus.Up)) { return new ValidationResult(VdcBllMessages.VDS_ALREADY_UP); } + if (vds.getStatus().equals(VDSStatus.NonResponsive)) { + return new ValidationResult(VdcBllMessages.VDS_NON_RESPONSIVE); + } return ValidationResult.VALID; } } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java index 40c7f76..08daf42 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java @@ -213,6 +213,7 @@ VDS_CANNOT_MAINTENANCE_SPM_CONTENDING(ErrorType.CONFLICT), VDS_CANNOT_MAINTENANCE_VDS_IS_IN_MAINTENANCE(ErrorType.CONFLICT), VDS_ALREADY_UP(ErrorType.CONFLICT), + VDS_NON_RESPONSIVE(ErrorType.CONFLICT), VDS_DOES_NOT_EXIST(ErrorType.BAD_PARAMETERS), VDS_STATUS_NOT_VALID_FOR_STOP(ErrorType.CONFLICT), VDS_STATUS_NOT_VALID_FOR_START(ErrorType.CONFLICT), diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 8515679..3500ab2 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -89,6 +89,7 @@ VDS_STATUS_NOT_VALID_FOR_UPDATE=Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational.\n\ Please switch Host to Maintenance mode first. VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP=Cannot ${action} ${type}. Host in Up status. +VDS_NON_RESPONSIVE=Cannot ${action} ${type}. Host is non responsive. VDS_DOES_NOT_EXIST=Cannot ${action} ${type}. Host does not exist. VDS_INVALID_SERVER_ID=Cannot ${action} ${type}. Invalid Host Id. VDS_EMPTY_NAME_OR_ID=Cannot ${action} ${type}. Empty host name or id. diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index b9ed2a7..7deb67b 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -208,6 +208,9 @@ @DefaultStringValue("Cannot ${action} ${type}. Host in Up status.") String VDS_ALREADY_UP(); + @DefaultStringValue("Cannot ${action} ${type}. Host is non responsive.") + String VDS_NON_RESPONSIVE(); + @DefaultStringValue("Cannot ${action} ${type}. Host does not exist.") String VDS_DOES_NOT_EXIST(); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 9a59604..281b5a7 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -89,6 +89,7 @@ VDS_STATUS_NOT_VALID_FOR_UPDATE=Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational.\n\ Please switch Host to Maintenance mode first. VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP=Cannot ${action} ${type}. Host in Up status. +VDS_NON_RESPONSIVE=Cannot ${action} ${type}. Host is non responsive. VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST=Cannot ${action} ${type}. Host does not exist. VDS_INVALID_SERVER_ID=Cannot ${action} ${type}. Invalid Host Id. VDS_EMPTY_NAME_OR_ID=Cannot ${action} ${type}. Empty host name or id. diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 990a34c..11d20a1 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -88,6 +88,7 @@ VDS_STATUS_NOT_VALID_FOR_UPDATE=Cannot ${action} ${type}. Host parameters cannot be modified while Host is operational.\n\ Please switch Host to Maintenance mode first. VDS_ALREADY_UP=Cannot ${action} ${type}. Host in Up status. +VDS_NON_RESPONSIVE=Cannot ${action} ${type}. Host in non responsive status. VDS_DOES_NOT_EXIST=Cannot ${action} ${type}. Host does not exist. VDS_INVALID_SERVER_ID=Cannot ${action} ${type}. Invalid Host Id. VDS_EMPTY_NAME_OR_ID=Cannot ${action} ${type}. Empty host name or id. -- To view, visit http://gerrit.ovirt.org/16650 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02846c6e1bc780f5b80a9e99c167f49d24c6bc57 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
