Skip to content
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 /etc/sudoers #3425

Merged
merged 0 commits into from
Jun 2, 2022
Merged

feat: new spec and parser for /etc/sudoers #3425

merged 0 commits into from
Jun 2, 2022

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented May 27, 2022

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

Add your description here

@xiangce xiangce requested a review from psachin May 31, 2022 07:02
from insights.parsers.sudoers import EtcSudoers


@combiner(EtcSudoers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiangce Generally we develop combiner out of two or more components. Is there are special requirement because of which you decide to create a combiner out of EtcSudoers parser alone?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the code of get() & last() in the combiner as well as the parser is redundant.

Copy link
Contributor Author

@xiangce xiangce Jun 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EtcSudoers is against a multi_output=Ture spec, which results in the parser result being a list. This combiner is going to combine the result.

For the 2 functions, I created a base class and removed the duplicates. Please have a look again.

@xiangce xiangce merged commit b90b141 into master Jun 2, 2022
@xiangce xiangce deleted the sap_sudoers branch June 2, 2022 05:29
xiangce added a commit that referenced this pull request Jun 2, 2022
* New spec and parser for /etc/sudoers

Signed-off-by: Xiangce Liu <[email protected]>

* feat: New spec and parser for /etc/sudoers

Signed-off-by: Xiangce Liu <[email protected]>

* fix combiner to check the '#includedir' directive

Signed-off-by: Xiangce Liu <[email protected]>

* single test func

Signed-off-by: Xiangce Liu <[email protected]>

* add note for #inlcudedir

Signed-off-by: Xiangce Liu <[email protected]>

* add the missed multi_output=True

Signed-off-by: Xiangce Liu <[email protected]>

* add a base class

Signed-off-by: Xiangce Liu <[email protected]>

* add note to the combiner for the base class

Signed-off-by: Xiangce Liu <[email protected]>

* refine the doc

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit b90b141)
xiangce added a commit that referenced this pull request Sep 6, 2024
* New spec and parser for /etc/sudoers

Signed-off-by: Xiangce Liu <[email protected]>

* feat: New spec and parser for /etc/sudoers

Signed-off-by: Xiangce Liu <[email protected]>

* fix combiner to check the '#includedir' directive

Signed-off-by: Xiangce Liu <[email protected]>

* single test func

Signed-off-by: Xiangce Liu <[email protected]>

* add note for #inlcudedir

Signed-off-by: Xiangce Liu <[email protected]>

* add the missed multi_output=True

Signed-off-by: Xiangce Liu <[email protected]>

* add a base class

Signed-off-by: Xiangce Liu <[email protected]>

* add note to the combiner for the base class

Signed-off-by: Xiangce Liu <[email protected]>

* refine the doc

Signed-off-by: Xiangce Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants