Hello Francesco Romani, Milan Zamazal,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/63974

to review the following change.

Change subject: virt: Correct disconnectAction parameter extraction
......................................................................

virt: Correct disconnectAction parameter extraction

The disconnectAction has previously never been passed to the
_setTicketForGraphicDev method. This patch fixes this oversight.

Backport-To: 4.0
Bug-Url: https://bugzilla.redhat.com/1349383
Bug-Url: https://bugzilla.redhat.com/1371264
Change-Id: Ia1695a56d3f7e68f8f9b8d2a929775edc4570985
Signed-off-by: Vinzenz Feenstra <vfeen...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/59692
Reviewed-by: Milan Zamazal <mzama...@redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <from...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/63974/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 4a4fa91..3bc775c 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2261,7 +2261,8 @@
         if graphics:
             result = self._setTicketForGraphicDev(
                 graphics, params['password'], params['ttl'],
-                params['existingConnAction'], params['params'])
+                params.get('existingConnAction'),
+                params.get('disconnectAction'), params['params'])
             if result['status']['code'] == 0:
                 result['vmList'] = self.status()
             return result
@@ -3729,9 +3730,10 @@
             return response.error('ticketErr',
                                   'no graphics devices configured')
         return self._setTicketForGraphicDev(
-            graphics, otp, seconds, connAct, params)
+            graphics, otp, seconds, connAct, None, params)
 
-    def _setTicketForGraphicDev(self, graphics, otp, seconds, connAct, params):
+    def _setTicketForGraphicDev(self, graphics, otp, seconds, connAct,
+                                disconnectAction, params):
         graphics.setAttribute('passwd', otp.value)
         if int(seconds) > 0:
             validto = time.strftime('%Y-%m-%dT%H:%M:%S',
@@ -3742,9 +3744,8 @@
         hooks.before_vm_set_ticket(self._domain.xml, self.conf, params)
         try:
             self._dom.updateDeviceFlags(graphics.toxml(), 0)
-            disconnectAction = params.get('disconnectAction',
-                                          ConsoleDisconnectAction.LOCK_SCREEN)
-            self._consoleDisconnectAction = disconnectAction
+            self._consoleDisconnectAction = disconnectAction or \
+                ConsoleDisconnectAction.LOCK_SCREEN
         except virdomain.TimeoutError as tmo:
             res = response.error('ticketErr', unicode(tmo))
         else:


-- 
To view, visit https://gerrit.ovirt.org/63974
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1695a56d3f7e68f8f9b8d2a929775edc4570985
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Vinzenz Feenstra <vfeen...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to