Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inhibit the upgrade when a marker file is present on the system #100

Open
wants to merge 2 commits into
base: almalinux
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/leapp-simulate-inhibitor"):
reporting.create_report([
reporting.Title('Upgrade blocked by /etc/leapp-simulate-inhibitor'),
reporting.Summary(
'/etc/leapp-simulate-inhibitor file is present, upgrade blocked by dummy_inhibitor actor.'
),
reporting.Severity(reporting.Severity.HIGH),
reporting.Tags([reporting.Tags.SANITY]),
reporting.Flags([reporting.Flags.INHIBITOR]),
])