-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename system_user_dirs to rpm_pkgs (#3597)
* Rename system_user_dirs to system_user_pkgs Signed-off-by: Jitka Obselkova <[email protected]> * Rename function to be more descriptive Signed-off-by: Jitka Obselkova <[email protected]> * Rename whole module to be more descriptive Signed-off-by: Jitka Obselkova <[email protected]> * Keep code conventions Signed-off-by: Jitka Obselkova <[email protected]> Signed-off-by: Jitka Obselkova <[email protected]>
- Loading branch information
Showing
11 changed files
with
70 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. automodule:: insights.parsers.rpm_pkgs | ||
:members: | ||
:show-inheritance: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
RpmPkgs - datasource ``rpm_pkgs`` | ||
================================= | ||
Parser for CVE-2021-35937, CVE-2021-35938, and CVE-2021-35939. | ||
For more information, see the ``rpm_pkgs`` datasource. | ||
""" | ||
|
||
from insights import Parser, parser | ||
from insights.specs import Specs | ||
|
||
|
||
@parser(Specs.rpm_pkgs) | ||
class RpmPkgs(Parser): | ||
""" | ||
Class for enabling the data from the ``rpm_pkgs`` datasource. | ||
Sample output of this datasource is:: | ||
["httpd-core"] | ||
Examples: | ||
>>> type(rpm_pkgs) | ||
<class 'insights.parsers.rpm_pkgs.RpmPkgs'> | ||
>>> rpm_pkgs.packages | ||
['httpd-core'] | ||
""" | ||
|
||
def parse_content(self, content): | ||
self.packages = content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import doctest | ||
|
||
from insights.parsers import rpm_pkgs | ||
from insights.parsers.rpm_pkgs import RpmPkgs | ||
from insights.tests import context_wrap | ||
|
||
PACKAGES = ["httpd-core"] | ||
|
||
|
||
def test_system_user_dirs(): | ||
test = RpmPkgs(context_wrap(PACKAGES)) | ||
assert test.packages == PACKAGES | ||
|
||
|
||
def test_doc_examples(): | ||
env = { | ||
"rpm_pkgs": RpmPkgs(context_wrap(PACKAGES)) | ||
} | ||
failed, total = doctest.testmod(rpm_pkgs, globs=env) | ||
assert failed == 0 |
This file was deleted.
Oops, something went wrong.