Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
ERROR return value is 3 and UNKNOW return value is 2.
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Jun 1, 2016
1 parent 67ca739 commit 2144504
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion man/preupg.1
Expand Up @@ -73,7 +73,7 @@ Possible return values are:

\fB2\fP - preupg works properly but modules finishes with 2. Modules exits with results UNKNOWN, FAILED.

\fB3\fP - preupg works properly but modules finishes with 2. Modules exits with results ERROR.
\fB3\fP - preupg works properly but modules finishes with 3. Modules exits with results ERROR.

\fB10\fP - preupg does not find a proper upgrade scenario.

Expand Down
11 changes: 11 additions & 0 deletions preup/xccdf.py
Expand Up @@ -85,6 +85,17 @@ def check_inplace_risk(xccdf_file, verbose):

inplace_risk = []
target_tree = ElementTree.fromstring(content)
# Check if report does not contain UNKNOWN or ERROR results.
results = []
for profile in target_tree.findall(XMLNS + "TestResult"):
for check in profile.findall(".//" + XMLNS + "result"):
if check.text not in results:
results.append(check.text)
if 'error' in results:
return 3
if 'unknown' in results:
return 2

for profile in target_tree.findall(XMLNS + "TestResult"):
inplace_risk = XccdfHelper.get_check_import_inplace_risk(profile)

Expand Down

0 comments on commit 2144504

Please sign in to comment.