Fixed issue #63
This commit is contained in:
parent
54cfa39b77
commit
112cfb3a4b
1 changed files with 9 additions and 3 deletions
|
|
@ -151,12 +151,16 @@ def is_valid_wim_file(item):
|
||||||
def get_mounted_volumes():
|
def get_mounted_volumes():
|
||||||
"""Get mounted volumes, returns dict."""
|
"""Get mounted volumes, returns dict."""
|
||||||
cmd = [
|
cmd = [
|
||||||
'findmnt', '-J', '-b', '-i',
|
'findmnt',
|
||||||
'-t', (
|
'--list',
|
||||||
|
'--json',
|
||||||
|
'--bytes',
|
||||||
|
'--invert',
|
||||||
|
'--types', (
|
||||||
'autofs,binfmt_misc,bpf,cgroup,cgroup2,configfs,debugfs,devpts,'
|
'autofs,binfmt_misc,bpf,cgroup,cgroup2,configfs,debugfs,devpts,'
|
||||||
'devtmpfs,hugetlbfs,mqueue,proc,pstore,securityfs,sysfs,tmpfs'
|
'devtmpfs,hugetlbfs,mqueue,proc,pstore,securityfs,sysfs,tmpfs'
|
||||||
),
|
),
|
||||||
'-o', 'SOURCE,TARGET,FSTYPE,LABEL,SIZE,AVAIL,USED']
|
'--output', 'SOURCE,TARGET,FSTYPE,LABEL,SIZE,AVAIL,USED']
|
||||||
json_data = get_json_from_command(cmd)
|
json_data = get_json_from_command(cmd)
|
||||||
mounted_volumes = []
|
mounted_volumes = []
|
||||||
for item in json_data.get('filesystems', []):
|
for item in json_data.get('filesystems', []):
|
||||||
|
|
@ -195,6 +199,8 @@ def mount_volumes(
|
||||||
volumes.update({child['name']: child})
|
volumes.update({child['name']: child})
|
||||||
for grandchild in child.get('children', []):
|
for grandchild in child.get('children', []):
|
||||||
volumes.update({grandchild['name']: grandchild})
|
volumes.update({grandchild['name']: grandchild})
|
||||||
|
for great_grandchild in grandchild.get('children', []):
|
||||||
|
volumes.update({great_grandchild['name']: great_grandchild})
|
||||||
|
|
||||||
# Get list of mounted volumes
|
# Get list of mounted volumes
|
||||||
mounted_volumes = get_mounted_volumes()
|
mounted_volumes = get_mounted_volumes()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue