+###############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+# szilard.cserey@ericsson.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
+
from lxml import etree
import common
check_file_exists = common.check_file_exists
check_if_root = common.check_if_root
+
class ExecutionEnvironment(object):
def __init__(self, storage_dir, dha_file, root_dir):
uuid.getparent().remove(uuid)
disks = vm_xml.xpath('/domain/devices/disk')
for disk in disks:
- if (disk.get('type') == 'file'
- and disk.get('device') == 'disk'):
+ if (disk.get('type') == 'file' and
+ disk.get('device') == 'disk'):
sources = disk.xpath('source')
for source in sources:
disk.remove(source)
disk.append(source)
with open(temp_vm_file, 'w') as f:
vm_xml.write(f, pretty_print=True, xml_declaration=True)
- exec_cmd('virsh define %s' % temp_vm_file)
\ No newline at end of file
+ exec_cmd('virsh define %s' % temp_vm_file)