Tomas Jelinek has uploaded a new change for review.

Change subject: non informative message engine: non informative message for 
force shutdown
......................................................................

non informative message
engine: non informative message for force shutdown

Scenario:
1) In webadmin create a VM (note that "Allow a user to connect to the
   console of this VM when a different user has also connected since
   the last boot." checkbox in Console options MUSTN'T be ticked -
   that's default option).
2) Add permissions to some user so user could connect to the VM from
   User Portal (user in user portal MUST be different form superuser you
   used for connecting to webadmin)
3) Start the VM from webadmin and connect to it using SPICE
4) Open User Portal
5) Try to connect to the VM from user portal using SPICE

Result: a non informative message is shown.

Added message: "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."

Change-Id: I3d07865ef11ca60cf2fd52d49f1de05a00caddb0
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetVmTicketCommand.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M backend/manager/modules/utils/src/test/resources/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
7 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/7364/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetVmTicketCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetVmTicketCommand.java
index 60faa92..5fb1599 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetVmTicketCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SetVmTicketCommand.java
@@ -54,6 +54,7 @@
         if (needPermissionForConnectingToConsole()) {
             permissions.add(new PermissionSubject(getVmId(), VdcObjectType.VM, 
ActionGroup.RECONNECT_TO_VM));
             neededPermissions = true;
+            addCanDoActionMessage(VdcBllMessages.VM_ALREADY_TAKEN);
         }
         return permissions;
     }
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java
index f4735bd..99265a9 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java
@@ -311,6 +311,7 @@
     MESSAGE_LICENSE_EVALUATION__PARAM_DAYS_LEFT,
     ERROR_LICENSE_ILLEGAL,
     USER_NOT_AUTHORIZED_TO_PERFORM_ACTION,
+    VM_ALREADY_TAKEN,
     ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE,
     ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION,
     ERROR_CANNOT_REMOVE_ROLE_INVALID_ROLE_ID,
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 b7f9a4a..d44a46b 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -294,6 +294,7 @@
 VM_CANNOT_SUSPEND_STATELESS_VM=Cannot suspend VM, VM is stateless.
 VM_CANNOT_SUSPEND_VM_FROM_POOL=Cannot suspend VM that belongs to a  VM-Pool.
 USER_NOT_AUTHORIZED_TO_PERFORM_ACTION=User is not authorized to perform this 
action.
+VM_ALREADY_TAKEN=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.
 ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION=One or more Permissions is 
still associated with Role.\n\
        - Please remove all Permissions first.
 ERROR_CANNOT_REMOVE_ROLE_INVALID_ROLE_ID=Cannot remove Role, invalid Role id.
diff --git 
a/backend/manager/modules/utils/src/test/resources/AppErrors.properties 
b/backend/manager/modules/utils/src/test/resources/AppErrors.properties
index a8e67c0..d451c84 100644
--- a/backend/manager/modules/utils/src/test/resources/AppErrors.properties
+++ b/backend/manager/modules/utils/src/test/resources/AppErrors.properties
@@ -202,6 +202,7 @@
 VM_POOL_CANNOT_CREATE_DUPLICATE_NAME=Cannot ${action} VM pool. VM pool with 
same name already exists.
 VM_POOL_CANNOT_CREATE_FROM_BLANK_TEMPLATE=Cannot create VM pool from blank 
template.
 USER_NOT_AUTHORIZED_TO_PERFORM_ACTION=User is not authorized to perform this 
action
+VM_ALREADY_TAKEN=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.
 ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION=One or more Permissions still 
associated with role. Please remove any permission first.
 ERROR_CANNOT_REMOVE_ROLE_INVALID_ROLE_ID=Can not remove role, invalid role id.
 ERROR_CANNOT_ATTACH_ACTION_TO_ROLE_ATTACHED=Cannot attach action to role. This 
action already attached to role.
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 c5331a8..eb436b0 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
@@ -814,6 +814,9 @@
     @DefaultStringValue("User is not authorized to perform this action.")
     String USER_NOT_AUTHORIZED_TO_PERFORM_ACTION();
 
+    @DefaultStringValue("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.")
+    String VM_ALREADY_TAKEN();
+
     @DefaultStringValue("One or more Permissions is still associated with 
Role.\n- Please remove all Permissions first.")
     String ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION();
 
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 7f71b58..460b8c2 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
@@ -292,6 +292,7 @@
 VM_CANNOT_SUSPEND_STATELESS_VM=Cannot suspend VM, VM is stateless.
 VM_CANNOT_SUSPEND_VM_FROM_POOL=Cannot suspend VM that belongs to a  VM-Pool.
 USER_NOT_AUTHORIZED_TO_PERFORM_ACTION=User is not authorized to perform this 
action.
+VM_ALREADY_TAKEN=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.
 ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION=One or more Permissions is 
still associated with Role.\n\
        - Please remove all Permissions first.
 ERROR_CANNOT_REMOVE_ROLE_INVALID_ROLE_ID=Cannot remove Role, invalid Role 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 3ce5492..60c3951 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
@@ -290,6 +290,7 @@
 VM_CANNOT_SUSPEND_STATELESS_VM=Cannot suspend VM, VM is stateless.
 VM_CANNOT_SUSPEND_VM_FROM_POOL=Cannot suspend VM that belongs to a  VM-Pool.
 USER_NOT_AUTHORIZED_TO_PERFORM_ACTION=User is not authorized to perform this 
action.
+VM_ALREADY_TAKEN=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.
 ERROR_CANNOT_REMOVE_ROLE_ATTACHED_TO_PERMISSION=One or more Permissions is 
still associated with Role.\n\
        - Please remove all Permissions first.
 ERROR_CANNOT_REMOVE_ROLE_INVALID_ROLE_ID=Cannot remove Role, invalid Role id.


--
To view, visit http://gerrit.ovirt.org/7364
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d07865ef11ca60cf2fd52d49f1de05a00caddb0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to