mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Get the loop device name in a less dramatic way
This commit is contained in:
parent
c917c3bd65
commit
6fb60a33f0
1 changed files with 2 additions and 2 deletions
|
@ -48,8 +48,8 @@ class LoopbackVolume(Volume):
|
|||
self.device_path = self.loop_device_path
|
||||
|
||||
def _link_dm_node(self, e):
|
||||
import re
|
||||
loop_device_name = re.match('^/dev/(?P<name>.*)$', self.loop_device_path).group('name')
|
||||
import os.path
|
||||
loop_device_name = os.path.basename(self.loop_device_path)
|
||||
from . import get_major_minor_dev_num
|
||||
major, minor = get_major_minor_dev_num(loop_device_name)
|
||||
sectors = self.size*1024*1024/512
|
||||
|
|
Loading…
Add table
Reference in a new issue