Bug fix to Remote Backups!

This commit is contained in:
usmannasir
2018-02-20 22:39:07 +05:00
parent fb89867663
commit 09bb3587d8
7 changed files with 506 additions and 222 deletions

View File

@@ -353,7 +353,6 @@ def loginAPI(request):
return HttpResponse(json_data)
def fetchSSHkey(request):
try:
if request.method == "POST":
@@ -365,16 +364,13 @@ def fetchSSHkey(request):
if hashPassword.check_password(admin.password, password):
keyPath = "/root/.ssh"
keyPath = os.path.join("/root",".ssh")
pubKey = keyPath + "/cyberpanel.pub"
execPath = "sudo cat " + pubKey
data = subprocess.check_output(shlex.split(execPath))
data_ret = {'pubKeyStatus': 1, 'error_message': "None", "pubKey":data}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -412,8 +408,6 @@ def remoteTransfer(request):
execPath = execPath + " remoteTransfer --ipAddress " + ipAddress + " --dir " + dir + " --accountsToTransfer " + accountsToTransfer
subprocess.Popen(shlex.split(execPath))
return HttpResponse(json.dumps({"transferStatus": 1, "dir": dir}))
@@ -432,7 +426,6 @@ def remoteTransfer(request):
json_data = json.dumps(data)
return HttpResponse(json_data)
def fetchAccountsFromRemoteServer(request):
try:
if request.method == "POST":