Sort imports
This commit is contained in:
@@ -1,27 +1,25 @@
|
|||||||
"""Stack Plugin for WordOps"""
|
"""Stack Plugin for WordOps"""
|
||||||
|
|
||||||
from cement.core.controller import CementBaseController, expose
|
|
||||||
from cement.core import handler, hook
|
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
import random
|
import random
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
import re
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
|
from cement.core import handler, hook
|
||||||
# from pynginxconfig import NginxConfig
|
from cement.core.controller import CementBaseController, expose
|
||||||
from wo.cli.plugins.site_functions import *
|
from wo.cli.plugins.site_functions import *
|
||||||
from wo.cli.plugins.sitedb import *
|
from wo.cli.plugins.sitedb import *
|
||||||
from wo.cli.plugins.stack_migrate import WOStackMigrateController
|
from wo.cli.plugins.stack_migrate import WOStackMigrateController
|
||||||
|
from wo.cli.plugins.stack_pref import post_pref, pre_pref
|
||||||
from wo.cli.plugins.stack_services import WOStackStatusController
|
from wo.cli.plugins.stack_services import WOStackStatusController
|
||||||
from wo.cli.plugins.stack_upgrade import WOStackUpgradeController
|
from wo.cli.plugins.stack_upgrade import WOStackUpgradeController
|
||||||
from wo.cli.plugins.stack_pref import pre_pref, post_pref
|
|
||||||
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.cron import WOCron
|
from wo.core.cron import WOCron
|
||||||
@@ -33,8 +31,8 @@ from wo.core.logging import Log
|
|||||||
from wo.core.mysql import WOMysql
|
from wo.core.mysql import WOMysql
|
||||||
from wo.core.services import WOService
|
from wo.core.services import WOService
|
||||||
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
||||||
from wo.core.variables import WOVariables
|
|
||||||
from wo.core.template import WOTemplate
|
from wo.core.template import WOTemplate
|
||||||
|
from wo.core.variables import WOVariables
|
||||||
|
|
||||||
|
|
||||||
def wo_stack_hook(app):
|
def wo_stack_hook(app):
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
from cement.core.controller import CementBaseController, expose
|
|
||||||
from cement.core import handler, hook
|
|
||||||
from wo.core.mysql import WOMysql
|
|
||||||
from wo.core.logging import Log
|
|
||||||
from wo.core.variables import WOVariables
|
|
||||||
from wo.core.aptget import WOAptGet
|
|
||||||
from wo.core.shellexec import WOShellExec
|
|
||||||
from wo.core.apt_repo import WORepo
|
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from cement.core import handler, hook
|
||||||
|
from cement.core.controller import CementBaseController, expose
|
||||||
|
from wo.core.apt_repo import WORepo
|
||||||
|
from wo.core.aptget import WOAptGet
|
||||||
|
from wo.core.logging import Log
|
||||||
|
from wo.core.mysql import WOMysql
|
||||||
|
from wo.core.shellexec import WOShellExec
|
||||||
|
from wo.core.variables import WOVariables
|
||||||
|
|
||||||
|
|
||||||
class WOStackMigrateController(CementBaseController):
|
class WOStackMigrateController(CementBaseController):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -4,22 +4,25 @@ import os
|
|||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
import psutil
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
import psutil
|
||||||
from wo.cli.plugins.site_functions import *
|
from wo.cli.plugins.site_functions import *
|
||||||
from wo.cli.plugins.stack_services import WOStackStatusController
|
from wo.cli.plugins.stack_services import WOStackStatusController
|
||||||
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.checkfqdn import check_fqdn_ip
|
||||||
from wo.core.cron import WOCron
|
from wo.core.cron import WOCron
|
||||||
|
from wo.core.domainvalidate import GetDomainlevel
|
||||||
from wo.core.extract import WOExtract
|
from wo.core.extract import WOExtract
|
||||||
from wo.core.fileutils import WOFileUtils
|
from wo.core.fileutils import WOFileUtils
|
||||||
from wo.core.git import WOGit
|
from wo.core.git import WOGit
|
||||||
from wo.core.template import WOTemplate
|
|
||||||
from wo.core.logging import Log
|
from wo.core.logging import Log
|
||||||
from wo.core.mysql import WOMysql
|
from wo.core.mysql import WOMysql
|
||||||
from wo.core.services import WOService
|
from wo.core.services import WOService
|
||||||
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
||||||
|
from wo.core.template import WOTemplate
|
||||||
from wo.core.variables import WOVariables
|
from wo.core.variables import WOVariables
|
||||||
|
|
||||||
|
|
||||||
@@ -359,16 +362,16 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
'/etc/nginx/sites-available')
|
'/etc/nginx/sites-available')
|
||||||
os.makedirs('/etc/nginx/sites-enabled')
|
os.makedirs('/etc/nginx/sites-enabled')
|
||||||
|
|
||||||
# 22222 port settings
|
# 22222 port settings
|
||||||
if not os.path.isfile('/etc/nginx/sites-available/22222'):
|
data = dict(webroot=ngxroot)
|
||||||
data = dict(webroot=ngxroot)
|
WOTemplate.render(
|
||||||
WOTemplate.render(
|
self,
|
||||||
self,
|
'/etc/nginx/sites-available/22222',
|
||||||
'/etc/nginx/sites-available/22222',
|
'22222.mustache', data, overwrite=False)
|
||||||
'22222.mustache', data, overwrite=False)
|
passwd = ''.join([random.choice
|
||||||
passwd = ''.join([random.choice
|
(string.ascii_letters + string.digits)
|
||||||
(string.ascii_letters + string.digits)
|
for n in range(24)])
|
||||||
for n in range(24)])
|
if not os.path.isfile('/etc/nginx/htpasswd-wo'):
|
||||||
try:
|
try:
|
||||||
WOShellExec.cmd_exec(
|
WOShellExec.cmd_exec(
|
||||||
self, "printf \"WordOps:"
|
self, "printf \"WordOps:"
|
||||||
@@ -380,8 +383,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
Log.error(self, "Failed to save HTTP Auth")
|
Log.error(self, "Failed to save HTTP Auth")
|
||||||
|
if not os.path.islink('/etc/nginx/sites-enabled/22222'):
|
||||||
# Create Symbolic link for 22222
|
# Create Symbolic link for 22222
|
||||||
WOFileUtils.create_symlink(
|
WOFileUtils.create_symlink(
|
||||||
self, ['/etc/nginx/'
|
self, ['/etc/nginx/'
|
||||||
'sites-available/'
|
'sites-available/'
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
from cement.core.controller import CementBaseController, expose
|
|
||||||
from cement.core import handler, hook
|
|
||||||
from wo.core.services import WOService
|
|
||||||
from wo.core.logging import Log
|
|
||||||
from wo.core.variables import WOVariables
|
|
||||||
from wo.core.aptget import WOAptGet
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from cement.core import handler, hook
|
||||||
|
from cement.core.controller import CementBaseController, expose
|
||||||
|
from wo.core.aptget import WOAptGet
|
||||||
|
from wo.core.logging import Log
|
||||||
|
from wo.core.services import WOService
|
||||||
|
from wo.core.variables import WOVariables
|
||||||
|
|
||||||
|
|
||||||
class WOStackStatusController(CementBaseController):
|
class WOStackStatusController(CementBaseController):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from cement.core.controller import CementBaseController, expose
|
|
||||||
from cement.core import handler, hook
|
from cement.core import handler, hook
|
||||||
|
from cement.core.controller import CementBaseController, expose
|
||||||
|
from wo.cli.plugins.stack_pref import post_pref, pre_pref
|
||||||
from wo.core.aptget import WOAptGet
|
from wo.core.aptget import WOAptGet
|
||||||
from wo.core.download import WODownload
|
from wo.core.download import WODownload
|
||||||
from wo.core.extract import WOExtract
|
from wo.core.extract import WOExtract
|
||||||
@@ -11,7 +12,6 @@ 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 pre_pref, post_pref
|
|
||||||
|
|
||||||
|
|
||||||
class WOStackUpgradeController(CementBaseController):
|
class WOStackUpgradeController(CementBaseController):
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
from cement.core.controller import CementBaseController, expose
|
|
||||||
from cement.core import handler, hook
|
|
||||||
from wo.core.fileutils import WOFileUtils
|
|
||||||
from wo.cli.plugins.sitedb import updateSiteInfo, getAllsites
|
|
||||||
from wo.core.mysql import WOMysql, StatementExcecutionError
|
|
||||||
from wo.core.logging import Log
|
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
|
from cement.core import handler, hook
|
||||||
|
from cement.core.controller import CementBaseController, expose
|
||||||
|
from wo.cli.plugins.sitedb import getAllsites, updateSiteInfo
|
||||||
|
from wo.core.fileutils import WOFileUtils
|
||||||
|
from wo.core.logging import Log
|
||||||
|
from wo.core.mysql import StatementExcecutionError, WOMysql
|
||||||
|
|
||||||
|
|
||||||
def wo_sync_hook(app):
|
def wo_sync_hook(app):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user