mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +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
|
return result
|
||||||
|
|
||||||
def status_instances(self, vmid, action, instancetype="lxc"):
|
def status_instances(self, id, action):
|
||||||
""" Find node/cluster informations from vmid """
|
""" Find node/cluster informations from vmid """
|
||||||
try:
|
try:
|
||||||
instances_informations = self.mongo.get_instances(vmid)
|
instances_informations = self.mongo.generalmongosearch("instances", id)["value"]
|
||||||
|
|
||||||
""" Find cluster informations from node """
|
""" Find cluster informations from node """
|
||||||
clusters_informations = self.mongo.get_clusters_conf(instances_informations['cluster'])["value"]
|
clusters_informations = self.mongo.get_clusters_conf(instances_informations['cluster'])["value"]
|
||||||
|
|
||||||
|
|
||||||
proxmox_clusters_url = clusters_informations["url"]
|
proxmox_clusters_url = clusters_informations["url"]
|
||||||
proxmox_clusters_port = clusters_informations["port"]
|
proxmox_clusters_port = clusters_informations["port"]
|
||||||
proxmox_clusters_user = pdecrypt(base64.b64decode(clusters_informations["user"]),
|
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,
|
result = proxmox.status_instances("{0}:{1}".format(proxmox_clusters_url,
|
||||||
int(proxmox_clusters_port)),
|
int(proxmox_clusters_port)),
|
||||||
instances_informations['node'],
|
instances_informations['node'],
|
||||||
instancetype,
|
instances_informations['type'],
|
||||||
vmid, action)
|
instances_informations['vmid'], action)
|
||||||
|
|
||||||
except IndexError as ierror:
|
except IndexError as ierror:
|
||||||
result = {
|
result = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue