mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-22 15:32:05 +01:00
p3
This commit is contained in:
@@ -28,7 +28,7 @@ class CLManagerMain(multi.Thread):
|
||||
elif self.function == 'enableOrDisable':
|
||||
self.enableOrDisable()
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
||||
|
||||
def renderC(self):
|
||||
@@ -77,7 +77,7 @@ class CLManagerMain(multi.Thread):
|
||||
execPath = execPath + " --function submitCageFSInstall"
|
||||
ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||
|
||||
def findWebsitesJson(self, currentACL, userID, pageNumber):
|
||||
@@ -144,7 +144,7 @@ class CLManagerMain(multi.Thread):
|
||||
'pagination': pagination, 'default': default}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
dic = {'status': 1, 'listWebSiteStatus': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(dic)
|
||||
return HttpResponse(json_data)
|
||||
@@ -160,7 +160,7 @@ class CLManagerMain(multi.Thread):
|
||||
for items in websites:
|
||||
command = '/usr/sbin/cagefsctl --disable %s' % (items.externalApp)
|
||||
ProcessUtilities.executioner(command)
|
||||
except BaseException, msg:
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
def fetchPackages(self, currentACL):
|
||||
|
||||
@@ -20,7 +20,7 @@ class CLinuxPackages:
|
||||
try:
|
||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||
statement = '%s %s' % (pwd.getpwnam(items.externalApp).pw_uid, clPackage.name)
|
||||
print statement
|
||||
print(statement)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -28,7 +28,7 @@ class CLinuxPackages:
|
||||
@staticmethod
|
||||
def listPackages():
|
||||
for items in CLPackages.objects.all():
|
||||
print items.name
|
||||
print(items.name)
|
||||
|
||||
@staticmethod
|
||||
def userIDPackage(user):
|
||||
@@ -36,7 +36,7 @@ class CLinuxPackages:
|
||||
itemPackage = website.package
|
||||
try:
|
||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||
print clPackage
|
||||
print(clPackage)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -48,7 +48,7 @@ class CLinuxPackages:
|
||||
try:
|
||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||
if clPackage.name == package:
|
||||
print pwd.getpwnam(items.externalApp).pw_uid
|
||||
print(pwd.getpwnam(items.externalApp).pw_uid)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class CageFS:
|
||||
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():
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
from django.db import models
|
||||
from packages.models import Package
|
||||
|
||||
@@ -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 redirect, HttpResponse
|
||||
from loginSystem.views import loadLoginPage
|
||||
@@ -43,7 +43,7 @@ def submitCageFSInstall(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)
|
||||
@@ -104,7 +104,7 @@ def enableOrDisable(request):
|
||||
|
||||
|
||||
|
||||
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)
|
||||
@@ -169,7 +169,7 @@ def submitCreatePackage(request):
|
||||
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)
|
||||
@@ -213,7 +213,7 @@ def deleteCLPackage(request):
|
||||
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)
|
||||
@@ -266,7 +266,7 @@ def saveSettings(request):
|
||||
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)
|
||||
@@ -352,7 +352,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