diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-01 16:53:23 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-01 16:53:23 +0000 |
commit | a06ebc0405235a3081c77c8db694c65d3ff3e81c (patch) | |
tree | 096a4491a756feddfc60ea2b3ee536c4ec82be3d /morphlib/exts/openstack.write | |
parent | 1a32c137eb99e0a265c8afd99491bfb400b78c77 (diff) | |
parent | 3b8b8b54850f6aee870ec6a08000d08819ad4e81 (diff) | |
download | morph-a06ebc0405235a3081c77c8db694c65d3ff3e81c.tar.gz |
Merge branch 'baserock/pedroalvarez/rawdisk-to-device8'
Reviewed-by:
- Richard Maw
- Sam Thursfield
Diffstat (limited to 'morphlib/exts/openstack.write')
-rwxr-xr-x | morphlib/exts/openstack.write | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/morphlib/exts/openstack.write b/morphlib/exts/openstack.write index 516fe367..b1941d3c 100755 --- a/morphlib/exts/openstack.write +++ b/morphlib/exts/openstack.write @@ -79,8 +79,7 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension): def set_extlinux_root_to_virtio(self, raw_disk): '''Re-configures extlinux to use virtio disks''' self.status(msg='Updating extlinux.conf') - mp = self.mount(raw_disk) - try: + with self.mount(raw_disk) as mp: path = os.path.join(mp, 'extlinux.conf') with open(path) as f: @@ -91,9 +90,6 @@ class OpenStackWriteExtension(morphlib.writeexts.WriteExtension): with open(path, "w") as f: f.write(extlinux_conf) - finally: - self.unmount(mp) - def get_openstack_parameters(self): '''Get the environment variables needed. |