Skip to content

Commit

Permalink
Revert "Raise SkipException when no packages are found in installed_r…
Browse files Browse the repository at this point in the history
…pms"

This reverts commit b105e87.
  • Loading branch information
xiangce committed Jul 7, 2020
1 parent b105e87 commit 5f2c223
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
6 changes: 0 additions & 6 deletions insights/parsers/installed_rpms.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
from ..util import rsplit
from .. import parser, get_active_lines, CommandParser
from .rpm_vercmp import rpm_version_compare
from insights.parsers import SkipException
from insights.specs import Specs

# This list of architectures is taken from PDC (Product Definition Center):
Expand Down Expand Up @@ -216,9 +215,6 @@ class InstalledRpms(CommandParser, RpmList):
"""
A parser for working with data containing a list of installed RPM files on the system and
related information.
Raises:
SkipException: When no packages are found.
"""
def __init__(self, *args, **kwargs):
self.errors = []
Expand Down Expand Up @@ -248,8 +244,6 @@ def parse_content(self, content):
except Exception:
# Both ways failed
self.unparsed.append(line)
if not self.packages:
raise SkipException()
# Don't want defaultdict's behavior after parsing is complete
self.packages = dict(self.packages)

Expand Down
16 changes: 0 additions & 16 deletions insights/parsers/tests/test_installed_rpms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from insights.parsers.installed_rpms import InstalledRpms, InstalledRpm, pad_version
from insights.parsers import SkipException
from insights.tests import context_wrap


Expand Down Expand Up @@ -81,18 +80,6 @@
yum-security-1.1.16-21.el5.noarch
'''.strip()

ERROR_DB_NO_PKG = """
error: rpmdb: BDB0113 Thread/process 20263/140251984590912 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal
error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
error: rpmdb: BDB0113 Thread/process 20263/140251984590912 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal
error, run database recovery
error: cannot open Packages database in /var/lib/rpm
""".strip()

ORACLEASM_RPMS = '''
oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64
oracleasmlib-2.0.4-1.el5.x86_64
Expand Down Expand Up @@ -211,9 +198,6 @@ def test_corrupt_db():
assert "yum-security" in rpms.packages
assert rpms.corrupt is True

with pytest.raises(SkipException):
InstalledRpms(context_wrap(ERROR_DB_NO_PKG))


def test_rpm_manifest():
rpms = InstalledRpms(context_wrap(RPM_MANIFEST))
Expand Down

0 comments on commit 5f2c223

Please sign in to comment.