Vinzenz Feenstra has uploaded a new change for review.
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
Change-Id: Ia1695a56d3f7e68f8f9b8d2a929775edc4570985
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Reviewed-on:
https://gerrit.ovirt.org/59692
Reviewed-by: Milan Zamazal <mzamazal(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
(cherry picked from commit 7c6905edf642574de44261afbb979bc5fb3ef1a2)
---
M vdsm/virt/vm.py
1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/59842/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0fe722e..b040902 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2417,7 +2417,8 @@
if graphics:
result = self._setTicketForGraphicDev(
graphics, params['password'], params['ttl'],
- params.get('existingConnAction'), params['params'])
+ params.get('existingConnAction'),
+ params.get('disconnectAction'), params['params'])
if result['status']['code'] == 0:
result['vmList'] = self.status()
return result
@@ -3930,9 +3931,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',
@@ -3943,9 +3945,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/59842
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1695a56d3f7e68f8f9b8d2a929775edc4570985
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>