mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-17 13:02:07 +01:00
p3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ class Container:
|
||||
length = len(Container.users)
|
||||
for items in Container.users:
|
||||
if (counter + 1) == length:
|
||||
print items + ' ' + Container.packages[counter]
|
||||
print(items + ' ' + Container.packages[counter])
|
||||
else:
|
||||
print items + ' ' + Container.packages[counter] + ' '
|
||||
print(items + ' ' + Container.packages[counter] + ' ')
|
||||
counter = counter + 1
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
@staticmethod
|
||||
@@ -33,12 +33,12 @@ class Container:
|
||||
length = len(Container.users)
|
||||
for items in Container.packages:
|
||||
if (counter + 1) == length:
|
||||
print items
|
||||
print(items)
|
||||
else:
|
||||
print items + '\n'
|
||||
print(items + '\n')
|
||||
counter = counter + 1
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
@staticmethod
|
||||
@@ -47,10 +47,10 @@ class Container:
|
||||
counter = 0
|
||||
for items in Container.users:
|
||||
if items == user:
|
||||
print Container.packages[counter]
|
||||
print(Container.packages[counter])
|
||||
return
|
||||
counter = counter + 1
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
@staticmethod
|
||||
@@ -59,10 +59,10 @@ class Container:
|
||||
counter = 0
|
||||
for items in Container.packages:
|
||||
if items == package:
|
||||
print Container.users[counter]
|
||||
print(Container.users[counter])
|
||||
return
|
||||
counter = counter + 1
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
@staticmethod
|
||||
@@ -88,7 +88,7 @@ class Container:
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||
"Packages successfully installed.[200]\n", 1)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||
|
||||
def main():
|
||||
|
||||
@@ -43,7 +43,7 @@ class ContainerManager(multi.Thread):
|
||||
self.addTrafficController()
|
||||
elif self.function == 'removeLimits':
|
||||
self.removeLimits()
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
||||
|
||||
@staticmethod
|
||||
@@ -78,7 +78,7 @@ class ContainerManager(multi.Thread):
|
||||
ioConf = ioConf.replace('{net_cls}', str(net_cls))
|
||||
|
||||
return ioConf
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
return 0
|
||||
|
||||
@@ -128,7 +128,7 @@ class ContainerManager(multi.Thread):
|
||||
execPath = execPath + " --function submitContainerInstall"
|
||||
ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||
|
||||
def restartServices(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.db import models
|
||||
from websiteFunctions.models import Websites
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.shortcuts import HttpResponse, redirect
|
||||
from loginSystem.views import loadLoginPage
|
||||
@@ -42,7 +42,7 @@ def submitContainerInstall(request):
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
@@ -117,7 +117,7 @@ def fetchWebsiteLimits(request):
|
||||
json_data = json.dumps(finalData)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
@@ -264,7 +264,7 @@ def saveWebsiteLimits(request):
|
||||
json_data = json.dumps(finalData)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
@@ -345,7 +345,7 @@ def getUsageData(request):
|
||||
final_json = json.dumps(finalData)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg), 'cpu': 0, 'memory':0}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
Reference in New Issue
Block a user