Skip to content

Commit 8a8fc19

Browse files
committed
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
1 parent fd92fe5 commit 8a8fc19

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

  • repos/system_upgrade/common/actors/dummyinhibitor
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from leapp.actors import Actor
2+
from leapp import reporting
3+
from leapp.reporting import Report
4+
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
5+
6+
import os
7+
8+
9+
class DummyInhibitor(Actor):
10+
"""
11+
Raise an inhibitor report to halt the upgrade process when the test marker is present.
12+
"""
13+
14+
name = 'dummy_inhibitor'
15+
consumes = ()
16+
produces = (Report,)
17+
tags = (IPUWorkflowTag, ChecksPhaseTag)
18+
19+
def process(self):
20+
if os.path.exists("/etc/noleapp"):
21+
reporting.create_report([
22+
reporting.Title('Upgrade blocked by /etc/noleapp'),
23+
reporting.Summary(
24+
'/etc/noleapp file is present, upgrade blocked by dummy_inhibitor actor.'
25+
),
26+
reporting.Severity(reporting.Severity.HIGH),
27+
reporting.Tags([reporting.Tags.SANITY]),
28+
reporting.Flags([reporting.Flags.INHIBITOR]),
29+
])

0 commit comments

Comments
 (0)