From e4ae5b20fb015bba6e77d82c2c585ff520d3efdf Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 28 Jul 2014 18:03:32 +0200 Subject: [PATCH] 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 Signed-off-by: Sebastien Goasguen --- scripts/vm/network/security_group.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py index 3f4c51ae18a..134a12690b8 100755 --- a/scripts/vm/network/security_group.py +++ b/scripts/vm/network/security_group.py @@ -944,7 +944,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"