Sync c-h with loopback_devices() fix
PY3 bug in loopback_devices caused the related bug. This patch syncs just the relevant file to fix the bug into charmhelpers. Change-Id: I5aacd16c2bd4957c49210e867dc76efa1a315ab4 Closes-Bug: #1804128
This commit is contained in:
parent
3066151e77
commit
25ec6c6a3d
|
@ -36,8 +36,10 @@ def loopback_devices():
|
|||
'''
|
||||
loopbacks = {}
|
||||
cmd = ['losetup', '-a']
|
||||
devs = [d.strip().split(' ') for d in
|
||||
check_output(cmd).splitlines() if d != '']
|
||||
output = check_output(cmd)
|
||||
if six.PY3:
|
||||
output = output.decode('utf-8')
|
||||
devs = [d.strip().split(' ') for d in output.splitlines() if d != '']
|
||||
for dev, _, f in devs:
|
||||
loopbacks[dev.replace(':', '')] = re.search(r'\((\S+)\)', f).groups()[0]
|
||||
return loopbacks
|
||||
|
|
Loading…
Reference in New Issue