mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-11-16 06:30:39 +00:00
client.py token login
This commit is contained in:
parent
27628c5cf0
commit
907f4cb6fb
@ -44,6 +44,21 @@ class ProxmoxClient:
|
|||||||
self.config.config["pve"]["server"], self.config.config["pve"]["user"]
|
self.config.config["pve"]["server"], self.config.config["pve"]["user"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.config.config["pve"]["token_name"]:
|
||||||
|
if !self.config.config["pve"]["token_value"]:
|
||||||
|
self.logger.error("Token name require token value to be set ! Fallback to password authentification")
|
||||||
|
|
||||||
|
self.logger.debug("Using token login")
|
||||||
|
return ProxmoxAPI(
|
||||||
|
self.config.config["pve"]["server"],
|
||||||
|
user=self.config.config["pve"]["user"],
|
||||||
|
token_name=self.config.config["pve"]["token_name"],
|
||||||
|
token_value=self.config.config["pve"]["token_value"],
|
||||||
|
verify_ssl=to_bool(self.config.config["pve"]["verify_ssl"]),
|
||||||
|
timeout=self.config.config["pve"]["auth_timeout"]
|
||||||
|
)
|
||||||
|
|
||||||
return ProxmoxAPI(
|
return ProxmoxAPI(
|
||||||
self.config.config["pve"]["server"],
|
self.config.config["pve"]["server"],
|
||||||
user=self.config.config["pve"]["user"],
|
user=self.config.config["pve"]["user"],
|
||||||
|
Loading…
Reference in New Issue
Block a user