Skip to content
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