Arik Hadas has uploaded a new change for review. Change subject: webadmin: minor refactoring in SpiceConsoleModel ......................................................................
webadmin: minor refactoring in SpiceConsoleModel Replace statements that check whether spice-driver-version or guest-agent-version in a VM is not null in order to see if the VM has spice-driver or guest-agent with calls to VM#getHasSpiceDriver and VM#getHasAgent methods Change-Id: Iad08ac04476defcfa0d53443390f762f023de96f Signed-off-by: Arik Hadas <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/40/11440/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java index d6903a8..1dc7ff6 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java @@ -121,7 +121,7 @@ } // If it is not windows or SPICE guest agent is not installed, make sure the WAN options are disabled. - if (!getEntity().getVmOs().isWindows() || getEntity().getSpiceDriverVersion() == null) { + if (!getEntity().getVmOs().isWindows() || !getEntity().getHasSpiceDriver()) { getspice().setIsWanOptionsEnabled(false); } @@ -377,8 +377,7 @@ // If 'AdminConsole' is true, send true; otherwise, false should be sent only for VMs with SPICE driver // installed. - getspice().setAdminConsole(getConfigurator().getSpiceAdminConsole() ? true - : getEntity().getSpiceDriverVersion() != null ? false : true); + getspice().setAdminConsole(getConfigurator().getSpiceAdminConsole() ? true : !getEntity().getHasSpiceDriver()); // Update 'UsbListenPort' value getspice().setUsbListenPort(getConfigurator().getIsUsbEnabled() @@ -543,7 +542,7 @@ // Only if the VM has agent and we connect through user-portal // we attempt to perform SSO (otherwise an error will be thrown) - if (!getConfigurator().getIsAdmin() && getEntity().getGuestAgentVersion() != null + if (!getConfigurator().getIsAdmin() && getEntity().getHasAgent() && getEntity().getStatus() == VMStatus.Up) { getLogger().Info("SpiceConsoleManager::Connect: Attempting to perform SSO on Desktop " //$NON-NLS-1$ + getEntity().getVmName()); -- To view, visit http://gerrit.ovirt.org/11440 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad08ac04476defcfa0d53443390f762f023de96f Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
