Irit Goihman has uploaded a new change for review.
Change subject: after_vm_destroy.py: migrate to jsonrpcvdscli
......................................................................
after_vm_destroy.py: migrate to jsonrpcvdscli
vdscli is deprecated and replaced by jsonrpcvdscli
Change-Id: I3f3fa6479dde2c4a1298d0ae167d888d9f7e020a
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M vdsm_hooks/vhostmd/after_vm_destroy.py
1 file changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/62383/1
diff --git a/vdsm_hooks/vhostmd/after_vm_destroy.py
b/vdsm_hooks/vhostmd/after_vm_destroy.py
index e8887bd..7064286 100644
--- a/vdsm_hooks/vhostmd/after_vm_destroy.py
+++ b/vdsm_hooks/vhostmd/after_vm_destroy.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
-# Copyright 2011 Red Hat, Inc.
+# Copyright 2011-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,14 +22,20 @@
import os
import subprocess
import hooking
-from vdsm import vdscli
-s = vdscli.connect()
+from vdsm.config import config
+from vdsm import jsonrpcvdscli
-res = s.list(True)
+requestQueues = config.get("addresses", "request_queues")
+requestQueue = requestQueues.split(",")[0]
+server = jsonrpcvdscli.connect(requestQueue=requestQueue)
+
+res = server.list(True)
if res['status']['code'] == 0:
if not [v for v in res['vmList']
if v.get('vmId') != os.environ.get('vmId') and
hooking.tobool(v.get('custom', {}).get('sap_agent',
False))]:
subprocess.call(['/usr/bin/sudo', '-n', '/sbin/service',
'vhostmd',
'stop'])
+
+server.close()
--
To view, visit
https://gerrit.ovirt.org/62383
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f3fa6479dde2c4a1298d0ae167d888d9f7e020a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>