Add stack_pref
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1357
wo/cli/plugins/stack_pref.py
Normal file
1357
wo/cli/plugins/stack_pref.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from cement.core import handler, hook
|
|
||||||
from cement.core.controller import CementBaseController, expose
|
from cement.core.controller import CementBaseController, expose
|
||||||
from wo.cli.plugins.stack import WOStackController
|
from cement.core import handler, hook
|
||||||
from wo.core.apt_repo import WORepo
|
from wo.core.apt_repo import WORepo
|
||||||
from wo.core.aptget import WOAptGet
|
from wo.core.aptget import WOAptGet
|
||||||
from wo.core.download import WODownload
|
from wo.core.download import WODownload
|
||||||
@@ -13,6 +12,7 @@ from wo.core.logging import Log
|
|||||||
from wo.core.services import WOService
|
from wo.core.services import WOService
|
||||||
from wo.core.shellexec import WOShellExec
|
from wo.core.shellexec import WOShellExec
|
||||||
from wo.core.variables import WOVariables
|
from wo.core.variables import WOVariables
|
||||||
|
from wo.cli.plugins.stack_pref import post_pref
|
||||||
|
|
||||||
|
|
||||||
class WOStackUpgradeController(CementBaseController):
|
class WOStackUpgradeController(CementBaseController):
|
||||||
@@ -86,8 +86,6 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
apt_packages = []
|
apt_packages = []
|
||||||
packages = []
|
packages = []
|
||||||
empty_packages = []
|
empty_packages = []
|
||||||
stack = WOStackController()
|
|
||||||
stack.app = self.app
|
|
||||||
|
|
||||||
if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and
|
if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and
|
||||||
(not self.app.pargs.php) and (not self.app.pargs.mysql) and
|
(not self.app.pargs.php) and (not self.app.pargs.mysql) and
|
||||||
@@ -192,7 +190,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
WOAptGet.update(self)
|
WOAptGet.update(self)
|
||||||
# Update packages
|
# Update packages
|
||||||
WOAptGet.install(self, apt_packages)
|
WOAptGet.install(self, apt_packages)
|
||||||
stack.post_pref(apt_packages, empty_packages)
|
post_pref(self, apt_packages, empty_packages)
|
||||||
# Post Actions after package updates
|
# Post Actions after package updates
|
||||||
if (set(WOVariables.wo_nginx).issubset(set(apt_packages))):
|
if (set(WOVariables.wo_nginx).issubset(set(apt_packages))):
|
||||||
WOService.restart_service(self, 'nginx')
|
WOService.restart_service(self, 'nginx')
|
||||||
|
|||||||
Reference in New Issue
Block a user