Irit Goihman has uploaded a new change for review.
Change subject: after_vm_start: changed vdscli to jsonrpcvdsli
......................................................................
after_vm_start: changed vdscli to jsonrpcvdsli
vdscli is deprecated and was replaced by jsonrpcvdsli
Change-Id: I66bd62164594c83167e8e72081325ff60d1c0cb0
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M vdsm_hooks/openstacknet/after_vm_start.py
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/62713/1
diff --git a/vdsm_hooks/openstacknet/after_vm_start.py
b/vdsm_hooks/openstacknet/after_vm_start.py
index 6f5c1e5..aa9b509 100644
--- a/vdsm_hooks/openstacknet/after_vm_start.py
+++ b/vdsm_hooks/openstacknet/after_vm_start.py
@@ -10,6 +10,7 @@
Where:
VM_ID should be replaced with the vm id.'''
+from contextlib import closing
import libvirt
import os
import time
@@ -17,16 +18,24 @@
import hooking
from openstacknet_utils import MARK_FOR_UNPAUSE_PATH
from openstacknet_utils import VM_ID_KEY
-from vdsm import vdscli
+from vdsm import config
+from vdsm import jsonrpcvdscli
OPENSTACK_NIC_WAIT_TIME = 15
+def connect_to_vdsm():
+ request_queues = config.get("addresses", "request_queues")
+ request_queue = request_queues.split(",")[0]
+ return jsonrpcvdscli.connect(requestQueue=request_queue)
+
+
def resume_paused_vm(vm_id):
unpause_file = MARK_FOR_UNPAUSE_PATH % vm_id
if os.path.isfile(unpause_file):
- vdscli.connect().cont(vm_id)
+ with closing(connect_to_vdsm()) as server:
+ server.cont(vm_id)
os.remove(unpause_file)
--
To view, visit
https://gerrit.ovirt.org/62713
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66bd62164594c83167e8e72081325ff60d1c0cb0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>