Skip to content

Commit c08e3c8

Browse files
committed
Adding "da build all" on the last step in elevation
1 parent 0e81dcd commit c08e3c8

File tree

1 file changed

+33
-0
lines changed
  • repos/system_upgrade/cloudlinux/actors/rebuilddirectadmin

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import os
2+
3+
from leapp.actors import Actor
4+
from leapp.libraries.stdlib import run, CalledProcessError
5+
from leapp.reporting import Report, create_report
6+
from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
7+
from leapp.libraries.common.cllaunch import run_on_cloudlinux
8+
9+
10+
class UpdateDirectAdmin(Actor):
11+
"""
12+
Automatically rebuild directadmin.
13+
"""
14+
15+
name = 'update_directadmin'
16+
consumes = ()
17+
produces = (Report,)
18+
tags = (FirstBootPhaseTag, IPUWorkflowTag)
19+
20+
@run_on_cloudlinux
21+
def process(self):
22+
if os.path.exists('/bin/da'):
23+
try:
24+
run(['/bin/da', 'build', 'all'], checked=True)
25+
self.log.info('DirectAdmin update was successful')
26+
except CalledProcessError as e:
27+
self.log.error(
28+
'Command "da build all" finished with exit code {}, '
29+
'the system might be unstable.\n'
30+
'Check /usr/local/directadmin/custombuild/custombuild.log, '
31+
'rerun "da build all" after fixing the issues. '
32+
'Contact DirectAdmin support for help.'.format(e.exit_code)
33+
)

0 commit comments

Comments
 (0)