mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
samba: Ignore mounted files when listing mounts
In a testing container, checked that the mount point /run/host/os-release is not listed on the Samba app page. Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
84eedfca03
commit
54a26f7741
@ -28,11 +28,12 @@ def get_share_mounts():
|
||||
|
||||
for mount in storage.get_mounts():
|
||||
mount_point = mount['mount_point']
|
||||
if mount_point not in ignore_mounts:
|
||||
basename = os.path.basename(mount_point)
|
||||
mount['name'] = basename or _('FreedomBox OS disk')
|
||||
mount['share_name_prefix'] = basename or 'disk'
|
||||
mounts.append(mount)
|
||||
if mount_point in ignore_mounts or os.path.isfile(mount_point):
|
||||
continue
|
||||
basename = os.path.basename(mount_point)
|
||||
mount['name'] = basename or _('FreedomBox OS disk')
|
||||
mount['share_name_prefix'] = basename or 'disk'
|
||||
mounts.append(mount)
|
||||
|
||||
return sorted(mounts, key=lambda k: k['mount_point'])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user