Muli Salem has uploaded a new change for review. Change subject: engine: RemoveVmInterface CanDoAction Message ......................................................................
engine: RemoveVmInterface CanDoAction Message This patch adds a message for when user tries to remove a VmNetworkInterface that is plugged to a running VM. Change-Id: I0976cedbbd25301293d70cddfc99c36b7cf95923 Bug-Url: https://bugzilla.redhat.com/906405 Signed-off-by: Muli Salem <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/RemoveVmInterfaceCommand.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 5 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/11955/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/RemoveVmInterfaceCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/RemoveVmInterfaceCommand.java index 215b9eb..a8d9de0 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/RemoveVmInterfaceCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/RemoveVmInterfaceCommand.java @@ -71,4 +71,10 @@ return getSucceeded() ? AuditLogType.NETWORK_REMOVE_VM_INTERFACE : AuditLogType.NETWORK_REMOVE_VM_INTERFACE_FAILED; } + + @Override + protected void setActionMessageParameters() { + addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE); + addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE); + } } 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 5250277..270f548 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -828,6 +828,7 @@ ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID=Cannot ${action} ${type}. The Network Interface ${IfaceName} has an invalid MAC address ${MacAddress}. MAC address must be in format "HH:HH:HH:HH:HH:HH" where H is a hexadecimal character (either a digit or A-F, case is insignificant). MIGRATE_PAUSED_VM_IS_UNSUPPORTED=Migrating a VM in paused status is unsupported. VM_INTERFACE_NOT_EXIST=Cannot ${action} ${type}. The VM Network Interface does not exist. +ACTION_TYPE_FAILED_CANNOT_REMOVE_ACTIVE_DEVICE=Cannot ${action} ${type}. The VM Network Interface is plugged to a running VM. VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED=Cannot ${action} ${type}. Enabling both Virt and Gluster services is not allowed. ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE=Engine is running in Maintenance mode and is not accepting commands. ENGINE_IS_RUNNING_IN_PREPARE_MODE=This action is not allowed when Engine is preparing for maintenance. 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 0f93076..6657b57 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 @@ -2196,6 +2196,9 @@ @DefaultStringValue("Cannot ${action} ${type}. The VM Network Interface does not exist.") String VM_INTERFACE_NOT_EXIST(); + @DefaultStringValue("Cannot ${action} ${type}. The VM Network Interface is plugged to a running VM.") + String ACTION_TYPE_FAILED_CANNOT_REMOVE_ACTIVE_DEVICE(); + @DefaultStringValue("Cannot ${action} ${type}. Enabling both Virt and Gluster services is not allowed.") String VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED(); 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 8850f5f..c7844ed 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 @@ -769,6 +769,7 @@ ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID=Cannot ${action} ${type}. The Network Interface ${IfaceName} has an invalid MAC address ${MacAddress}. MAC address must be in format "HH:HH:HH:HH:HH:HH" where H is a hexadecimal character (either a digit or A-F, case is insignificant). MIGRATE_PAUSED_VM_IS_UNSUPPORTED=Migrating a VM in paused status is unsupported. VM_INTERFACE_NOT_EXIST=Cannot ${action} ${type}. The VM Network Interface does not exist. +ACTION_TYPE_FAILED_CANNOT_REMOVE_ACTIVE_DEVICE=Cannot ${action} ${type}. The VM Network Interface is plugged to a running VM. USER_CANNOT_FORCE_RECONNECT_TO_VM=Console connection denied. Another user has already accessed the console of this VM. The VM should be rebooted to allow another user to access it, or changed by an admin to not enforce reboot between users accessing its console. ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE=Engine is running in Maintenance mode and is not accepting commands. ENGINE_IS_RUNNING_IN_PREPARE_MODE=This action is not allowed when Engine is preparing for maintenance. 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 3e35b77..38c06a7 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 @@ -770,6 +770,7 @@ VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED=Cannot ${action} ${type}. Enabling both Virt and Gluster services is not allowed. VM_INTERFACE_NOT_EXIST=Cannot ${action} ${type}. The VM Network Interface does not exist. +ACTION_TYPE_FAILED_CANNOT_REMOVE_ACTIVE_DEVICE=Cannot ${action} ${type}. The VM Network Interface is plugged to a running VM. USER_CANNOT_FORCE_RECONNECT_TO_VM=Console connection denied. Another user has already accessed the console of this VM. The VM should be rebooted to allow another user to access it, or changed by an admin to not enforce reboot between users accessing its console. ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE=Engine is running in Maintenance mode and is not accepting commands. ENGINE_IS_RUNNING_IN_PREPARE_MODE=This action is not allowed when Engine is preparing for maintenance. -- To view, visit http://gerrit.ovirt.org/11955 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0976cedbbd25301293d70cddfc99c36b7cf95923 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Muli Salem <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
