Use os.path.basename() instead of string splitting.

Fixes bug 886268.

Change-Id: I16e05f4ead55c75f29217072d106421fdc7de201
This commit is contained in:
Russell Bryant 2012-01-31 15:25:33 -05:00
parent fe56d3c6ba
commit 541f747f05
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class Mount(object):
assert(os.path.exists(self.device)) assert(os.path.exists(self.device))
if self.partition: 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) self.partition)
assert(not os.path.exists(map_path)) assert(not os.path.exists(map_path))