Skip to content

chore: deprecate *ConfigPerms parsers #4450

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions insights/parsers/config_file_perms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,25 @@
from insights.core.plugins import parser
from insights.specs import Specs
from insights.util.file_permissions import FilePermissions
from insights.util import deprecated


class FilePermissionsParser(CommandParser, FilePermissions):
"""
.. warning::
This parser is deprecated, please use
:py:class:`insights.parsers.ls.LSlHFiles` instead.

Base class for ``SshdConfigPerms``, ``Grub1ConfigPerms`` and ``Grub2ConfigPerms`` classes.

Attributes:
line (string): the line from the command output
"""

def __init__(self, context):
deprecated(
FilePermissionsParser, "Please use insights.parsers.ls.LSlHFiles instead.", "3.7.0"
)
self.line = ""
CommandParser.__init__(self, context)
FilePermissions.__init__(self, self.line)
Expand All @@ -41,6 +49,10 @@ def parse_content(self, content):
@parser(Specs.sshd_config_perms)
class SshdConfigPerms(FilePermissionsParser):
"""
.. warning::
This parser is deprecated, please use
:py:class:`insights.parsers.ls.LSlHFiles` instead.

Class for parsing ``/bin/ls -lH /etc/ssh/sshd_config`` command.

Sample output of this command is::
Expand All @@ -61,6 +73,10 @@ def __init__(self, context):
@parser(Specs.grub1_config_perms)
class Grub1ConfigPerms(FilePermissionsParser):
"""
.. warning::
This parser is deprecated, please use
:py:class:`insights.parsers.ls.LSlHFiles` instead.

Class for parsing ``/bin/ls -lH /boot/grub/grub.conf`` command.

Sample output of this command is::
Expand All @@ -81,6 +97,10 @@ def __init__(self, context):
@parser(Specs.grub_config_perms)
class Grub2ConfigPerms(FilePermissionsParser):
"""
.. warning::
This parser is deprecated, please use
:py:class:`insights.parsers.ls.LSlHFiles` instead.

Class for parsing ``/bin/ls -lH /boot/grub2/grub.cfg`` command.

Sample output of this command is::
Expand Down
Loading