summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-09-27 20:33:17 +0000
committerVishvananda Ishaya <vishvananda@gmail.com>2012-09-27 22:57:23 +0000
commit81fa6f717d6e32a4cfc2c734e228e60b204da045 (patch)
treed5329440ecc47ee308d5b7108ee6390a5a7e422a /nova/tests
parent0d565de78b5cc8ecdd18e10444ec731db46b48eb (diff)
libvirt: allows attach and detach from all domains
Previously attaching/detaching from a shutoff domain would fail. Fixes bug 1057730 Change-Id: I876872700da125cb078746401b1b80da265880ff
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/fakelibvirt.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/tests/fakelibvirt.py b/nova/tests/fakelibvirt.py
index e4328a00b..b933b004a 100644
--- a/nova/tests/fakelibvirt.py
+++ b/nova/tests/fakelibvirt.py
@@ -69,8 +69,11 @@ VIR_DOMAIN_SHUTOFF = 5
VIR_DOMAIN_CRASHED = 6
VIR_DOMAIN_XML_SECURE = 1
+
VIR_DOMAIN_UNDEFINE_MANAGED_SAVE = 1
+VIR_DOMAIN_AFFECT_CURRENT = 0
+
VIR_CPU_COMPARE_ERROR = -1
VIR_CPU_COMPARE_INCOMPATIBLE = 0
VIR_CPU_COMPARE_IDENTICAL = 1
@@ -334,11 +337,17 @@ class Domain(object):
self._def['devices']['disks'] += [disk_info]
return True
+ def attachDeviceFlags(self, xml, _flags):
+ self.attachDevice(xml)
+
def detachDevice(self, xml):
disk_info = _parse_disk_info(etree.fromstring(xml))
disk_info['_attached'] = True
return disk_info in self._def['devices']['disks']
+ def detachDeviceFlags(self, xml, _flags):
+ self.detachDevice(xml)
+
def XMLDesc(self, flags):
disks = ''
for disk in self._def['devices']['disks']: