commit 92dda3b5a7c62201ce21aaa1741038255c429ad6
Author: Radek Novacek <rnovacek(a)redhat.com>
Date: Mon Aug 4 14:12:37 2014 +0200
libvirtd: use info() when state() is not implemented
state() method is not implemented on older libvirt, use first value from
info() instead.
virt/virt.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/virt/virt.py b/virt/virt.py
index 3db2a85..288d800 100644
--- a/virt/virt.py
+++ b/virt/virt.py
@@ -36,8 +36,9 @@ class Domain(dict):
try:
self['state'] = domain.state(0)[0]
except AttributeError:
- # Some versions of libvirt doesn't have domain.state() method
- pass
+ # Some versions of libvirt doesn't have domain.state() method,
+ # use first value from info instead
+ self['state'] = domain.info()[0]
class Virt(object):
Show replies by date