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