Merge lp:~arges/uvtool/ds-qcow2 into lp:~uvtool-dev/uvtool/trunk

Proposed by Chris J Arges
Status: Merged
Approved by: Robie Basak
Approved revision: 100
Merge reported by: Robie Basak
Merged at revision: not available
Proposed branch: lp:~arges/uvtool/ds-qcow2
Merge into: lp:~uvtool-dev/uvtool/trunk
Diff against target: 20 lines (+2/-2)
1 file modified
uvtool/libvirt/kvm.py (+2/-2)
To merge this branch: bzr merge lp:~arges/uvtool/ds-qcow2
Reviewer Review Type Date Requested Status
Robie Basak Approve
Review via email: mp+294293@code.launchpad.net

Description of the change

This makes snapshotting work out of the box and makes the naming consistent.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

Use long arguments whenever possible.
  replace '-d qcow2' with
  --disk-format=qcow2

lp:~arges/uvtool/ds-qcow2 updated
100. By Chris J Arges

Ensure ds image is in qcow2 format.

This makes the naming consistent and also makes things like virsh snapshotting
work out of the box.

Revision history for this message
Chris J Arges (arges) wrote :

Pushed a new rev with long args.

Revision history for this message
Robie Basak (racb) wrote :

lgtm

review: Approve
Revision history for this message
Robie Basak (racb) wrote :

Fixed in git master, thanks. This introduces bug 1623947 (cannot "uvt-kvm destroy" a VM with snapshots) but that's a separate issue really.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'uvtool/libvirt/kvm.py'
2--- uvtool/libvirt/kvm.py 2015-03-20 11:29:49 +0000
3+++ uvtool/libvirt/kvm.py 2016-05-10 22:55:31 +0000
4@@ -199,7 +199,7 @@
5 f.write(meta_data_fobj.read())
6
7 subprocess.check_call(
8- ['cloud-localds', 'ds.img', 'userdata', 'metadata'], cwd=temp_dir)
9+ ['cloud-localds', '--disk-format=qcow2', 'ds.img', 'userdata', 'metadata'], cwd=temp_dir)
10
11
12 def create_ds_volume(new_volume_name, hostname, user_data_fobj, meta_data_fobj):
13@@ -210,7 +210,7 @@
14 create_ds_image(temp_dir, hostname, user_data_fobj, meta_data_fobj)
15 with open(os.path.join(temp_dir, 'ds.img'), 'rb') as f:
16 return uvtool.libvirt.create_volume_from_fobj(
17- new_volume_name, f, pool_name=POOL_NAME)
18+ new_volume_name, f, image_type='qcow2', pool_name=POOL_NAME)
19 finally:
20 shutil.rmtree(temp_dir)
21

Subscribers

People subscribed via source and target branches