Skip to content

Commit

Permalink
Ignore CageFS XFS mountpoints (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
prilr authored Jul 18, 2023
1 parent dbcdea1 commit 6f2f036
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from leapp.libraries.stdlib import api, run
from leapp.libraries.stdlib import api, run, CalledProcessError
from leapp.models import StorageInfo, XFSPresence


Expand All @@ -21,11 +21,18 @@ def scan_xfs_mount(data):


def is_xfs_without_ftype(mp):
for l in run(['/usr/sbin/xfs_info', '{}'.format(mp)], split=True)['stdout']:
if 'ftype=0' in l:
return True

return False
try:
for l in run(['/usr/sbin/xfs_info', '{}'.format(mp)], split=True)['stdout']:
if 'ftype=0' in l:
return True
return False
# xfs_info can sometimes throw errors like the following if fed a CageFS mountpoint.
# xfs_info: /usr/share/cagefs-skeleton/var/www/cgi-bin\040(deleted) is not a mounted XFS filesystem
except CalledProcessError as err:
if "cagefs" in mp:
api.current_logger().info("CageFS XFS mountpoint {} ignored in scanner".format(mp))
return False
raise err


def scan_xfs():
Expand Down

0 comments on commit 6f2f036

Please sign in to comment.