-
Notifications
You must be signed in to change notification settings - Fork 181
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
FEAT: new custom filter 'fstab_mounted.dirs' to ls_lan spec #4255
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4255 +/- ##
=======================================
Coverage 77.14% 77.14%
=======================================
Files 762 762
Lines 41476 41483 +7
Branches 8763 8765 +2
=======================================
+ Hits 31997 32004 +7
+ Misses 8422 8421 -1
- Partials 1057 1058 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Xinting Li <[email protected]>
Signed-off-by: Xinting Li <[email protected]>
Signed-off-by: xintli <[email protected]>
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.
Please check my comments to the relevant Jira card.
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
insights/collect.py
Outdated
@@ -241,6 +241,10 @@ | |||
enabled: true | |||
- name: insights.components.selinux.SELinuxEnabled | |||
enabled: true | |||
|
|||
# needed for the 'ls lan' spec |
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.
Better explain it a bit clearer, e.g. needed for the 'spec.fstab_mounted' to the 'ls_lan' spec
insights/specs/datasources/ls.py
Outdated
return _list_items(Specs.ls_lan_dirs) | ||
filters = _list_items(Specs.ls_lan_dirs) | ||
if 'specs.fstab_mounted' in filters and FSTab in broker: | ||
filter_list = filters.split() |
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.
This seems a redundant operation, better update the _list_items
and let it return a sorted
list instead. (you may want to update all other datasources
to join
the new value returned by _list_items
insights/specs/datasources/ls.py
Outdated
filter_list = filters.split() | ||
for mntp in broker[FSTab].mounted_on.keys(): | ||
mnt_point = os.path.dirname(mntp) | ||
filter_list.extend([mnt_point] if mnt_point and mnt_point not in filter_list else []) |
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.
declear the filter_list
as a set first to avoid duplicate element in nature.
filter_list = set(_list_items(Specs.ls_lan_dirs)) # assume the _list_items returns `list` here already
for mntp in broker[FSTab].mounted_on.keys():
filter_list.add(os.path.dirname(mntp))
...
return ' '.join(filter_list)
Signed-off-by: xintli <[email protected]>
Signed-off-by: xintli <[email protected]>
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.
The code LGTM !
Signed-off-by: xintli <[email protected]>
Signed-off-by: Xinting Li <[email protected]> (cherry picked from commit 2c292ce)
Signed-off-by: Xinting Li <[email protected]> (cherry picked from commit 2c292ce) (cherry picked from commit ba3819d)
All Pull Requests:
Check all that apply:
Complete Description of Additions/Changes:
fstab_mounted.dirs
to thels_lan
specit's not a real directory existing in any system, but a
switch
like keyword,to enable the
ls_lan_dirs
to involve the mounted points in the default/etc/fstab
configuration file as the
ls -lan
candidates.