-
Notifications
You must be signed in to change notification settings - Fork 184
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 spec and parser for"auditctl -l" #3496
Conversation
@xiangce Please help to review. |
* Add a new module for all "auditctl" commands Signed-off-by: Huanhuan Li <[email protected]>
deprecated( | ||
AuditctlStatus, | ||
"Please use the :class:`insights.parsers.auditctl.AuditdStatus` instead.", | ||
"3.1.25" |
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.
@psachin after discussion with @xiangce , we agree to add a new module to include the parsers about "auditctl" commands, because the original file name is "auditctl_status.py", it's not good to add other "auditctl" commands. And I mark the original one as deprecated. Now the version is wrong, I'm not sure which version I should use, please help here, thanks.
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.
3.1.25 is OK
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 introduce a global variable, e.g. "NEXT_MINOR_VER", to avoid such kind of confusion.
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.
Currently, the exact version list isn't done, so a few parsers are marked as "3.1.25". Sachin said it is a release which is one year later. After the version list comes out, maybe we'll mark different versions for the parser. Maybe in one release, there is only one parser deprecated. In this case, maybe a global variable is useless? Do we need to do it now for "3.1.25"?
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.
Sorry for the incomplete comment, that is for @psachin, but not a blocker for this PR, please go ahead and use the hard-coded 3.1.25
for this change.
Maybe in one release, there is only one parser deprecated. In this case, maybe a global variable is useless?
No matter how many component
(even none) would be deprecated in the next minor release version, it would be better to use a global variable than the hard-coded versions, from the development and release perspective.
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.
insights/parsers/auditctl.py
Outdated
""" | ||
def parse_content(self, content): | ||
if not content: | ||
raise ParseException("Input content is empty.") |
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 should be a skip.
insights/parsers/auditctl.py
Outdated
self.data[k.strip()] = int(v.strip()) | ||
except ValueError: | ||
continue | ||
|
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 skip it when get nothing parsered
* Raise "ParseException" when the line isn't in expected format instead of pass it, maybe we need to enhance the parser. update the module docstring. raise SkipException when there is no known status output Signed-off-by: Huanhuan Li <[email protected]>
Signed-off-by: Huanhuan Li <[email protected]>
* feat: New spec "auditctl -l" * Add a new module for all "auditctl" commands Signed-off-by: Huanhuan Li <[email protected]> * Replace the parent class "LegacyItemAccess" to "dict" * Raise "ParseException" when the line isn't in expected format instead of pass it, maybe we need to enhance the parser. update the module docstring. raise SkipException when there is no known status output Signed-off-by: Huanhuan Li <[email protected]> * Rename "AuditdStatus" to "AuditStatus" Signed-off-by: Huanhuan Li <[email protected]> Signed-off-by: Huanhuan Li <[email protected]> (cherry picked from commit 0bd77b4)
* feat: New spec "auditctl -l" * Add a new module for all "auditctl" commands Signed-off-by: Huanhuan Li <[email protected]> * Replace the parent class "LegacyItemAccess" to "dict" * Raise "ParseException" when the line isn't in expected format instead of pass it, maybe we need to enhance the parser. update the module docstring. raise SkipException when there is no known status output Signed-off-by: Huanhuan Li <[email protected]> * Rename "AuditdStatus" to "AuditStatus" Signed-off-by: Huanhuan Li <[email protected]> Signed-off-by: Huanhuan Li <[email protected]>
Signed-off-by: Huanhuan Li [email protected]
All Pull Requests:
Check all that apply:
This update is targeting to add a new spec and parser for "auditctl -l". Since there is an existing module
auditctl_status
, and the existing parser didn't follow the latest design. This PR also:auditctl
related parsers toauditctl
module.