1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-03-09 15:40:18 +00:00

Fix data=> value changes

This commit is contained in:
Tlams 2018-04-28 13:26:32 +01:00
parent 072311a2c7
commit 9eab298ac0

View file

@ -148,10 +148,10 @@ class Core:
proxmox_clusters_url = clusters_informations["url"]
proxmox_clusters_port = clusters_informations["port"]
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_clusters_pwd = pdecrypt(base64.b64decode(clusters_informations["password"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_template = clusters_informations["template"]
proxmox_storages_disk = clusters_informations["storages_disk"]
@ -261,10 +261,10 @@ class Core:
proxmox_clusters_url = clusters_informations["url"]
proxmox_clusters_port = clusters_informations["port"]
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_clusters_pwd = pdecrypt(base64.b64decode(clusters_informations["password"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
""" LOAD PROXMOX """
proxmox = Proxmox(instances_informations['node'])
proxmox.get_ticket("{0}:{1}".format(proxmox_clusters_url,
@ -301,10 +301,10 @@ class Core:
proxmox_clusters_url = clusters_informations["url"]
proxmox_clusters_port = clusters_informations["port"]
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_clusters_pwd = pdecrypt(base64.b64decode(clusters_informations["password"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
""" LOAD PROXMOX """
proxmox = Proxmox(instances_informations['node'])
proxmox.get_ticket("{0}:{1}".format(proxmox_clusters_url,
@ -338,10 +338,10 @@ class Core:
proxmox_clusters_url = clusters_informations["url"]
proxmox_clusters_port = clusters_informations["port"]
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_clusters_pwd = pdecrypt(base64.b64decode(clusters_informations["password"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
""" LOAD PROXMOX """
proxmox = Proxmox(instances_informations['node'])
proxmox.get_ticket("{0}:{1}".format(proxmox_clusters_url,
@ -375,10 +375,10 @@ class Core:
proxmox_clusters_url = clusters_informations["url"]
proxmox_clusters_port = clusters_informations["port"]
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
proxmox_clusters_pwd = pdecrypt(base64.b64decode(clusters_informations["password"]),
self.generalconf["keys"]["key_pvt"])["data"].decode('utf-8')
self.generalconf["keys"]["key_pvt"])["value"].decode('utf-8')
""" LOAD PROXMOX """
proxmox = Proxmox(instances_informations['node'])
@ -430,8 +430,8 @@ class Core:
testdata = valid_clusters_data(data)
if not testdata:
if not self.mongo.get_clusters_conf(data["name"])["value"]:
data["user"] = base64.b64encode(pcrypt(data["user"], self.generalconf["keys"]["key_pvt"])["data"]).decode('utf-8')
data["password"] = base64.b64encode(pcrypt(data["password"], self.generalconf["keys"]["key_pvt"])["data"]).decode('utf-8')
data["user"] = base64.b64encode(pcrypt(data["user"], self.generalconf["keys"]["key_pvt"])["value"]).decode('utf-8')
data["password"] = base64.b64encode(pcrypt(data["password"], self.generalconf["keys"]["key_pvt"])["value"]).decode('utf-8')
new_cluster = self.mongo.insert_clusters_conf(data)
else:
new_cluster = {