File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
repos/system_upgrade/cloudlinux/actors/rebuilddirectadmin Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 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+ )
You can’t perform that action at this time.
0 commit comments