summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorAndy Southgate <andy.southgate@citrix.com>2011-01-21 12:00:45 +0000
committerAndy Southgate <andy.southgate@citrix.com>2011-01-21 12:00:45 +0000
commit1dbdb180cb93a812f8336bbfc49bf67a5203d1eb (patch)
tree00ef56bbe160449437bd24a0ee4250ef6c12272b /nova/virt
parent8f531ef7c0782feba46f83ec2e45d113753c4052 (diff)
OS-55: Fix current unit tests
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/fake.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index e8352771c..836252730 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -161,6 +161,10 @@ def after_VBD_create(vbd_ref, vbd_rec):
vm_name_label = _db_content['VM'][vm_ref]['name_label']
vbd_rec['vm_name_label'] = vm_name_label
+def after_VM_create(vm_ref, vm_rec):
+ """Create read-only fields in the VM record."""
+ if 'is_control_domain' not in vm_rec:
+ vm_rec['is_control_domain'] = False
def create_pbd(config, host_ref, sr_ref, attached):
return _create_object('PBD', {
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index eb699d715..9b78a178a 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -459,7 +459,7 @@ class VMHelper(HelperBase):
if mount_required:
def _mounted_processing(device):
- """Callback whioch runds with the image VDI attached"""
+ """Callback which runs with the image VDI attached"""
dev_path = '/dev/'+device+'1' # NB: Partition 1 hardcoded
tmpdir = tempfile.mkdtemp()
@@ -467,7 +467,7 @@ class VMHelper(HelperBase):
# Mount only Linux filesystems, to avoid disturbing
# NTFS images
try:
- _, err = utils.execute(
+ out, err = utils.execute(
'sudo mount -t ext2,ext3 "%s" "%s"' %
(dev_path, tmpdir))
except exception.ProcessExecutionError as e: