diff options
author | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2010-11-05 14:30:01 +0000 |
---|---|---|
committer | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2010-11-05 14:30:01 +0000 |
commit | 9eae246e1816fb90e6c58bd7f81bd61d4b922c96 (patch) | |
tree | 0bfd9e1325360468bcc85df79e097903886c8c3b | |
parent | f910b48484cfd1f6f7dee77dc65a914f3b8f8b09 (diff) |
partition: Fix handling of partition objects backed by files
The current code can't handle unmounting of partition objects
backed by files, such as:
partition = job.partition(device='/tmp/looped', loop_size=1024,
mountpoint=job.tmpdir)
Because the code that looks for mountpoint forgets to take
into account that the device in such cases is /dev/loopX.
So instead of only looking for the first field of /etc/mtab
or /proc/mounts, also look the second field to see if matches
the specified mountpoint.
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@4906 592f7852-d20e-0410-864c-8624ca9c26a4
-rw-r--r-- | client/bin/partition.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/bin/partition.py b/client/bin/partition.py index c4fce66d..355d1b3f 100644 --- a/client/bin/partition.py +++ b/client/bin/partition.py @@ -510,7 +510,7 @@ class partition(object): if filename: for line in open_func(filename).readlines(): parts = line.split() - if parts[0] == self.device: + if parts[0] == self.device or parts[1] == self.mountpoint: return parts[1] # The mountpoint where it's mounted return None |