-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore XFS mountpoints in CageFS skeleton #84
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe better write "like the following one if it's given a CageFS mountpoint." |
||
except CalledProcessError as err: | ||
if "cagefs" in mp: | ||
api.current_logger().info("CageFS XFS mountpoint {} ignored in scanner".format(mp)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if there is an invalid cagefs mount (let's say specified in cagefs.mp file) without |
||
return False | ||
raise err | ||
|
||
|
||
def scan_xfs(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just
return any('ftype=0' in line for line in run(['/usr/sbin/xfs_info', '{}'.format(mp)], split=True)['stdout'])