Merge lp:~woggle/vmbuilder/misc-fixes into lp:vmbuilder

Proposed by Charles Reiss
Status: Needs review
Proposed branch: lp:~woggle/vmbuilder/misc-fixes
Merge into: lp:vmbuilder
Diff against target: 25 lines (+3/-1)
2 files modified
VMBuilder/disk.py (+2/-0)
VMBuilder/util.py (+1/-1)
To merge this branch: bzr merge lp:~woggle/vmbuilder/misc-fixes
Reviewer Review Type Date Requested Status
VMBuilder Pending
Review via email: mp+230926@code.launchpad.net

Description of the change

Fix bug 1019009 (seems to be caused by Disk.unmap() called with ignore_fail not actually ignore failures), and fix a typo in a debug message.

To post a comment you must log in.

Unmerged revisions

491. By Charles Reiss

Name correct plugin in debug message

490. By Charles Reiss

When ignore_fail is true in Disk.unmap, do not fail for already unmapped partitions where part.filename = None

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'VMBuilder/disk.py'
2--- VMBuilder/disk.py 2012-01-25 13:48:24 +0000
3+++ VMBuilder/disk.py 2014-08-15 06:50:19 +0000
4@@ -190,6 +190,8 @@
5 run_cmd('kpartx', '-d', self.filename, ignore_fail=ignore_fail)
6
7 for part in self.partitions:
8+ if ignore_fail and not part.filename:
9+ continue
10 logging.debug("Removing partition %s" % part.filename)
11 parted_oldmap=part.filename[len("/dev/mapper/"):-1]+"p"+part.filename[-1]
12 dmsetup_output = run_cmd('dmsetup', 'info', parted_oldmap, ignore_fail=True)
13
14=== modified file 'VMBuilder/util.py'
15--- VMBuilder/util.py 2013-03-06 21:18:31 +0000
16+++ VMBuilder/util.py 2014-08-15 06:50:19 +0000
17@@ -170,7 +170,7 @@
18 getattr(context, func)(*args, **kwargs)
19 except AttributeError as e:
20 logging.debug('No such method ({}) in context plugin ({})'.format(
21- func, plugin.__module__))
22+ func, context.__module__))
23
24 def tmp_filename(suffix='', tmp_root=None):
25 # There is a risk in using tempfile.mktemp(): it's not recommended

Subscribers

People subscribed via source and target branches