Skip to content

Commit e4ae5b2

Browse files
vincentbernatsebgoa
authored andcommitted
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>
1 parent 45deade commit e4ae5b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎scripts/vm/network/security_group.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,10 @@ def getvmId(vmName):
944944

945945
conn.close()
946946

947-
return dom.ID()
947+
res = dom.ID()
948+
if isinstance(res, int):
949+
res = str(res)
950+
return res
948951

949952
def getBrfw(brname):
950953
cmd = "iptables-save |grep physdev-is-bridged |grep FORWARD |grep BF |grep '\-o' | grep -w " + brname + "|awk '{print $9}' | head -1"

0 commit comments

Comments
 (0)