reformat code
* add security stack for futur usage * fix pep8 formatting issues
This commit is contained in:
@@ -697,7 +697,9 @@ def sitebackup(self, data):
|
||||
if data['wo_db_name']:
|
||||
Log.info(self, 'Backing up database \t\t', end='')
|
||||
try:
|
||||
if not WOShellExec.cmd_exec(self, "mysqldump --single-transaction {0} | pigz -9 -p\"$(nproc)\" > {1}/{0}.gz"
|
||||
if not WOShellExec.cmd_exec(self, "mysqldump --single-transaction "
|
||||
"{0} | pigz -9 -p\"$(nproc)\" "
|
||||
"> {1}/{0}.gz"
|
||||
.format(data['wo_db_name'],
|
||||
backup_path)):
|
||||
Log.info(self,
|
||||
|
||||
@@ -1159,7 +1159,7 @@ class WOStackController(CementBaseController):
|
||||
WOFileUtils.searchreplace(self, "{0}22222/htdocs/index.php"
|
||||
.format(WOVariables.wo_webroot),
|
||||
"eth0",
|
||||
"{0}".format(WOVariables.wo_wan_interface))
|
||||
"{0}".format(WOVariables.wo_wan))
|
||||
|
||||
Log.debug(self, "Setting Privileges to "
|
||||
"{0}22222/htdocs"
|
||||
|
||||
@@ -22,11 +22,11 @@ class WOVariables():
|
||||
wo_wpcli_path = '/usr/local/bin/wp '
|
||||
|
||||
# get wan network interface name
|
||||
wo_wan_interface = os.popen("ip -4 route get 8.8.8.8 | "
|
||||
"grep -oP \"dev [^[:space:]]+ \" "
|
||||
"| cut -d ' ' -f 2").read()
|
||||
if wo_wan_interface == '':
|
||||
wo_wan_interface = 'eth0'
|
||||
wo_wan = os.popen("/sbin/ip -4 route get 8.8.8.8 | "
|
||||
"grep -oP \"dev [^[:space:]]+ \" "
|
||||
"| cut -d ' ' -f 2").read()
|
||||
if wo_wan == '':
|
||||
wo_wan = 'eth0'
|
||||
|
||||
# Current date and time of System
|
||||
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')
|
||||
|
||||
Reference in New Issue
Block a user