Skip to content

Commit

Permalink
Inhibit the upgrade when the file /etc/noleapp is present on the system
Browse files Browse the repository at this point in the history
Created to assist in testing the Leapp failure scenarios in automated environments
  • Loading branch information
prilr committed Jun 17, 2024
1 parent fd92fe5 commit 8a8fc19
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions repos/system_upgrade/common/actors/dummyinhibitor/actor.py
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]),
])

0 comments on commit 8a8fc19

Please sign in to comment.