mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-02-14 20:22:13 +00:00
Fix - Change the system to use MongoDB ID
This commit is contained in:
parent
3668862faa
commit
47830ab2ee
1 changed files with 5 additions and 4 deletions
|
@ -285,14 +285,15 @@ class Core:
|
|||
|
||||
return result
|
||||
|
||||
def status_instances(self, vmid, action, instancetype="lxc"):
|
||||
def status_instances(self, id, action):
|
||||
""" Find node/cluster informations from vmid """
|
||||
try:
|
||||
instances_informations = self.mongo.get_instances(vmid)
|
||||
instances_informations = self.mongo.generalmongosearch("instances", id)["value"]
|
||||
|
||||
""" Find cluster informations from node """
|
||||
clusters_informations = self.mongo.get_clusters_conf(instances_informations['cluster'])["value"]
|
||||
|
||||
|
||||
proxmox_clusters_url = clusters_informations["url"]
|
||||
proxmox_clusters_port = clusters_informations["port"]
|
||||
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
|
||||
|
@ -310,8 +311,8 @@ class Core:
|
|||
result = proxmox.status_instances("{0}:{1}".format(proxmox_clusters_url,
|
||||
int(proxmox_clusters_port)),
|
||||
instances_informations['node'],
|
||||
instancetype,
|
||||
vmid, action)
|
||||
instances_informations['type'],
|
||||
instances_informations['vmid'], action)
|
||||
|
||||
except IndexError as ierror:
|
||||
result = {
|
||||
|
|
Loading…
Reference in a new issue