forked from oamg/leapp-repository
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inhibit the upgrade when the file /etc/noleapp is present on the system
Created to assist in testing the Leapp failure scenarios in automated environments
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
repos/system_upgrade/common/actors/dummyinhibitor/actor.py
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,29 @@ | ||
from leapp.actors import Actor | ||
from leapp import reporting | ||
from leapp.reporting import Report | ||
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag | ||
|
||
import os | ||
|
||
|
||
class DummyInhibitor(Actor): | ||
""" | ||
Raise an inhibitor report to halt the upgrade process when the test marker is present. | ||
""" | ||
|
||
name = 'dummy_inhibitor' | ||
consumes = () | ||
produces = (Report,) | ||
tags = (IPUWorkflowTag, ChecksPhaseTag) | ||
|
||
def process(self): | ||
if os.path.exists("/etc/noleapp"): | ||
reporting.create_report([ | ||
reporting.Title('Upgrade blocked by /etc/noleapp'), | ||
reporting.Summary( | ||
'/etc/noleapp file is present, upgrade blocked by dummy_inhibitor actor.' | ||
), | ||
reporting.Severity(reporting.Severity.HIGH), | ||
reporting.Tags([reporting.Tags.SANITY]), | ||
reporting.Flags([reporting.Flags.INHIBITOR]), | ||
]) |