improvements to upgrades

This commit is contained in:
usmannasir
2018-12-14 05:01:10 +05:00
parent 6456944731
commit e5b94180fe
4 changed files with 385 additions and 405 deletions

View File

@@ -22,15 +22,11 @@ class mysqlUtilities:
data = f.read()
password = data.split('\n', 1)[0]
logging.CyberCPLogFileWriter.writeToFile(password)
conn = mysql.connect(user='root', passwd=password)
cursor = conn.cursor()
logging.CyberCPLogFileWriter.writeToFile('hekkk')
return conn, cursor
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0, 0

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,6 @@ jsonpointer==1.9
kitchen==1.1.1
MarkupSafe==0.11
mock==2.0.0
MySQL-python==1.2.5
parsedatetime==2.4
pbr==4.0.4
perf==0.1
@@ -42,14 +41,12 @@ ptyprocess==0.6.0
pycparser==2.18
pycurl==7.19.0
pydns==2.3.6
pygobject==3.22.0
pygpgme==0.3
pyliblzma==0.5.3
pyOpenSSL==17.5.0
pyRFC3339==1.1
pyserial==2.6
python-dateutil==2.7.5
python-linux-procfs==0.4.9
pytz==2018.4
pyudev==0.15
pyxattr==0.5.1
@@ -57,19 +54,9 @@ PyYAML==3.10
requests==2.18.4
requests-file==1.4.3
s3transfer==0.1.13
schedutils==0.4
six==1.9.0
slip==0.4.0
slip.dbus==0.4.0
tldextract==2.2.0
urlgrabber==3.10
urllib3==1.22
virtualenv==16.0.0
yum-metadata-parser==1.1.4
zope.component==4.4.1
zope.deferredimport==4.3
zope.deprecation==4.3.0
zope.event==4.3.0
zope.hookable==4.2.0
zope.interface==4.5.0
zope.proxy==4.3.1
zope.interface==4.5.0

View File

@@ -16,6 +16,7 @@ try:
import time
from random import randint
import subprocess, shlex
from plogical.processUtilities import ProcessUtilities
except BaseException, msg:
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
logging.writeToFile(str(msg))
@@ -127,8 +128,14 @@ class S3Backups(multi.Thread):
break
if insertCron:
command = 'echo "0 24 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/s3Backups/s3Backups.py" >> ' + cronPath
subprocess.call(command, shell=True)
pathToFile = "/home/cyberpanel/" + str(randint(1000, 9999))
writeToFile = open(pathToFile, 'w')
for items in output:
writeToFile.writelines(items + '\n')
writeToFile.writelines('0 24 * * * root /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/s3Backups/s3Backups.py\n')
writeToFile.close()
command = 'sudo mv ' + pathToFile + ' /etc/crontab'
ProcessUtilities.executioner(command)
return proc.ajax(1, None)