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

Multiples fix

This commit is contained in:
Tlams 2018-04-28 18:57:20 +01:00
parent 97bc2a0248
commit 1955d0e65c
3 changed files with 21 additions and 14 deletions

View file

@ -41,13 +41,12 @@ def distribution(n, tokens_in_slots, slot_distributions):
class Analyse:
def __init__(self, clusters_conf, generalconf, logger):
def __init__(self, generalconf, logger):
"""
:param clusters_conf: Proxmox configurations
:param generalconf : General configuration
"""
self.generalconf = generalconf
self.clusters_conf = clusters_conf
self.logger = logger
""" LOAD MONGODB """
@ -55,6 +54,8 @@ class Analyse:
self.mongo.client = self.mongo.connect()
self.mongo.db = self.mongo.client.db
self.clusters_conf = self.mongo.get_clusters_conf()["value"]
def run(self, instancetype="all"):
""" Active logger"""
self.logger.write({"thread":threading.get_ident(), "result": "INFO", "type": "HYPERPROXMOX", "value": "Start logger - Analyst Module"})
@ -83,7 +84,12 @@ class Analyse:
""" AUTH """
proxmox = Proxmox("Analyse")
proxmox.get_ticket("{0}:{1}".format(cluster["url"], int(cluster["port"])), proxmox_clusters_user, proxmox_clusters_pwd)
connection = proxmox.get_ticket("{0}:{1}".format(cluster["url"], int(cluster["port"])), proxmox_clusters_user, proxmox_clusters_pwd)
""" ByPass and log if connection has failed """
if connection["result"] != "OK":
self.logger.write({"thread": threading.get_ident(), "result": "ERROR", "type": "HYPERPROXMOX", "value": connection})
continue
"""
##############