CLOUDSTACK-7193: handle domain ID being an int

Recent versions of libvirt (at least 0.9.8) will return an int when
queried for the ID of a domain, not a string. This breaks some parts of
the `security_group.py` script which expects a string containing an
int. Notably, this breaks the part handling VM reboots which is
therefore not executed.

Signed-off-by: Vincent Bernat <Vincent.Bernat@exoscale.ch>
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
This commit is contained in:
Vincent Bernat 2014-07-28 18:03:32 +02:00 committed by Sebastien Goasguen
parent 880bff28e0
commit 53650ed7bf
1 changed files with 4 additions and 1 deletions

View File

@ -937,7 +937,10 @@ def getvmId(vmName):
conn.close()
return dom.ID()
res = dom.ID()
if isinstance(res, int):
res = str(res)
return res
def getBrfw(brname):
cmd = "iptables-save |grep physdev-is-bridged |grep FORWARD |grep BF |grep '\-o' | grep -w " + brname + "|awk '{print $9}' | head -1"