Skip to content

CLOS-3241: Create Leapp upgrade finish marker file during the last phase #34

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

Merged
merged 1 commit into from
Feb 27, 2025
Merged
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
25 changes: 25 additions & 0 deletions repos/system_upgrade/cloudlinux/actors/createfinishmarker/actor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from datetime import datetime

from leapp.actors import Actor
from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
from leapp.libraries.common.cllaunch import run_on_cloudlinux


class CreateFinishMarker(Actor):
"""
Create a finish marker file to indicate that the upgrade has been completed.
Other utilities or tests can check for the existence of this file to determine if the upgrade has been completed.
"""

name = 'create_finish_marker'
description = 'Create a finish marker file to indicate that the upgrade has been completed.'
consumes = ()
produces = ()
# Place this actor as far as possible in the workflow, after the absolute majority of other actors have run
tags = (FirstBootPhaseTag.After, IPUWorkflowTag)

@run_on_cloudlinux
def process(self):
# Create a finish marker file to indicate that the upgrade has been completed
with open('/var/log/leapp/leapp-upgrade-finished', 'w') as marker_file:
marker_file.write('Leapp upgrade completed on: {}\n'.format(datetime.now()))
Loading