diff options
| author | Russell Bryant <rbryant@redhat.com> | 2012-01-31 15:25:33 -0500 |
|---|---|---|
| committer | Russell Bryant <rbryant@redhat.com> | 2012-01-31 15:25:33 -0500 |
| commit | 541f747f055d4a794e8dc50ea78ee6d10913ff26 (patch) | |
| tree | 57e2903de4c1c26f72f253e2d36ea23877a3742f | |
| parent | fe56d3c6ba27048a4d72dca7a9830061a551906c (diff) | |
Use os.path.basename() instead of string splitting.
Fixes bug 886268.
Change-Id: I16e05f4ead55c75f29217072d106421fdc7de201
| -rw-r--r-- | nova/virt/disk/mount.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/disk/mount.py b/nova/virt/disk/mount.py index c9afb9a74..a7ea77097 100644 --- a/nova/virt/disk/mount.py +++ b/nova/virt/disk/mount.py @@ -61,7 +61,7 @@ class Mount(object): assert(os.path.exists(self.device)) if self.partition: - map_path = '/dev/mapper/%sp%s' % (self.device.split('/')[-1], + map_path = '/dev/mapper/%sp%s' % (os.path.basename(self.device), self.partition) assert(not os.path.exists(map_path)) |
