Skip to content

Commit fcbc838

Browse files
authored
Merge pull request #34 from cloudlinux/finalize_marker
CLOS-3241: Create Leapp upgrade finish marker file during the last phase
2 parents 0ef37eb + fd96410 commit fcbc838

File tree

1 file changed

+25
-0
lines changed
  • repos/system_upgrade/cloudlinux/actors/createfinishmarker

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from datetime import datetime
2+
3+
from leapp.actors import Actor
4+
from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
5+
from leapp.libraries.common.cllaunch import run_on_cloudlinux
6+
7+
8+
class CreateFinishMarker(Actor):
9+
"""
10+
Create a finish marker file to indicate that the upgrade has been completed.
11+
Other utilities or tests can check for the existence of this file to determine if the upgrade has been completed.
12+
"""
13+
14+
name = 'create_finish_marker'
15+
description = 'Create a finish marker file to indicate that the upgrade has been completed.'
16+
consumes = ()
17+
produces = ()
18+
# Place this actor as far as possible in the workflow, after the absolute majority of other actors have run
19+
tags = (FirstBootPhaseTag.After, IPUWorkflowTag)
20+
21+
@run_on_cloudlinux
22+
def process(self):
23+
# Create a finish marker file to indicate that the upgrade has been completed
24+
with open('/var/log/leapp/leapp-upgrade-finished', 'w') as marker_file:
25+
marker_file.write('Leapp upgrade completed on: {}\n'.format(datetime.now()))

0 commit comments

Comments
 (0)