Sort Import, add check_fqdn_ip function
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
"""Logfile Plugin for WordOps"""
|
||||
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
from cement.core import handler, hook
|
||||
from wo.core.logging import Log
|
||||
from wo.cli.plugins.site_functions import logwatch
|
||||
from wo.core.variables import WOVariables
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from wo.core.shellexec import WOShellExec
|
||||
from wo.core.sendmail import WOSendMail
|
||||
from wo.core.mysql import WOMysql
|
||||
import os
|
||||
import glob
|
||||
import gzip
|
||||
import os
|
||||
|
||||
from cement.core import handler, hook
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
from wo.cli.plugins.site_functions import logwatch
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from wo.core.logging import Log
|
||||
from wo.core.mysql import WOMysql
|
||||
from wo.core.sendmail import WOSendMail
|
||||
from wo.core.shellexec import WOShellExec
|
||||
from wo.core.variables import WOVariables
|
||||
|
||||
|
||||
def wo_log_hook(app):
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""Maintenance Plugin for WordOps"""
|
||||
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
from cement.core import handler, hook
|
||||
from wo.core.logging import Log
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
from wo.core.aptget import WOAptGet
|
||||
from wo.core.logging import Log
|
||||
|
||||
|
||||
def wo_maintenance_hook(app):
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
# """WordOps site controller."""
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
from subprocess import Popen
|
||||
|
||||
from cement.core import handler, hook
|
||||
from wo.core.sslutils import SSL
|
||||
from wo.core.variables import WOVariables
|
||||
from wo.core.shellexec import WOShellExec
|
||||
from wo.core.domainvalidate import ValidateDomain, GetDomainlevel
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
from wo.cli.plugins.site_functions import *
|
||||
from wo.core.services import WOService
|
||||
from wo.cli.plugins.sitedb import (addNewSite, getSiteInfo,
|
||||
updateSiteInfo, deleteSiteInfo, getAllsites)
|
||||
from wo.cli.plugins.sitedb import (addNewSite, deleteSiteInfo, getAllsites,
|
||||
getSiteInfo, updateSiteInfo)
|
||||
from wo.core.domainvalidate import GetDomainlevel, ValidateDomain
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from wo.core.git import WOGit
|
||||
from wo.core.logging import Log
|
||||
from subprocess import Popen
|
||||
from wo.core.nginxhashbucket import hashbucket
|
||||
import os
|
||||
import glob
|
||||
import subprocess
|
||||
import json
|
||||
from wo.core.services import WOService
|
||||
from wo.core.shellexec import WOShellExec
|
||||
from wo.core.sslutils import SSL
|
||||
from wo.core.variables import WOVariables
|
||||
|
||||
|
||||
def wo_site_hook(app):
|
||||
@@ -31,7 +32,6 @@ class WOSiteController(CementBaseController):
|
||||
label = 'site'
|
||||
stacked_on = 'base'
|
||||
stacked_type = 'nested'
|
||||
exit_on_close = True
|
||||
description = ('Performs website specific operations')
|
||||
arguments = [
|
||||
(['site_name'],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from wo.core.shellexec import WOShellExec
|
||||
from wo.core.variables import WOVariables
|
||||
import requests
|
||||
|
||||
|
||||
def check_fqdn(self, wo_host):
|
||||
@@ -20,3 +21,18 @@ def check_fqdn(self, wo_host):
|
||||
else:
|
||||
wo_host = input("Enter hostname [fqdn]:")
|
||||
check_fqdn(self, wo_host)
|
||||
|
||||
|
||||
def check_fqdn_ip(self):
|
||||
"""Check if server hostname resolved server IP"""
|
||||
x = requests.get('http://v4.wordops.eu')
|
||||
ip = (x.text).strip()
|
||||
|
||||
wo_fqdn = WOVariables.wo_fqdn
|
||||
y = requests.get('http://v4.wordops.eu/dns/{0}/'.format(wo_fqdn))
|
||||
ip_fqdn = (y.text).strip()
|
||||
|
||||
if ip == ip_fqdn:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user