mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-09-27 17:28:08 +00:00
fix code style
This commit is contained in:
parent
23ce74943b
commit
7613e43ca6
@ -118,12 +118,16 @@ class PrometheusSD:
|
|||||||
for name, value in required:
|
for name, value in required:
|
||||||
if not value:
|
if not value:
|
||||||
self.log.sysexit_with_message(f"Option '{name}' is required but not set")
|
self.log.sysexit_with_message(f"Option '{name}' is required but not set")
|
||||||
|
|
||||||
if config.config["pve"]["token_name"] and not config.config["pve"]["token_value"]:
|
if config.config["pve"]["token_name"] and not config.config["pve"]["token_value"]:
|
||||||
self.log.sysexit_with_message(f"Option 'pve.token_name' require 'pve.token_value' to be set")
|
self.log.sysexit_with_message(
|
||||||
|
f"Option 'pve.token_name' require 'pve.token_value' to be set"
|
||||||
|
)
|
||||||
|
|
||||||
if not config.config["pve"]["token_name"] and not config.config["pve"]["password"]:
|
if not config.config["pve"]["token_name"] and not config.config["pve"]["password"]:
|
||||||
self.log.sysexit_with_message(f"Neither password nor API token have been set for pve authentication")
|
self.log.sysexit_with_message(
|
||||||
|
f"Neither password nor API token have been set for pve authentication"
|
||||||
|
)
|
||||||
|
|
||||||
self.logger.info(f"Using config file {config.config_file}")
|
self.logger.info(f"Using config file {config.config_file}")
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ 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_name"]:
|
||||||
self.logger.debug("Using token login")
|
self.logger.debug("Using token login")
|
||||||
return ProxmoxAPI(
|
return ProxmoxAPI(
|
||||||
self.config.config["pve"]["server"],
|
self.config.config["pve"]["server"],
|
||||||
@ -55,7 +55,7 @@ class ProxmoxClient:
|
|||||||
verify_ssl=to_bool(self.config.config["pve"]["verify_ssl"]),
|
verify_ssl=to_bool(self.config.config["pve"]["verify_ssl"]),
|
||||||
timeout=self.config.config["pve"]["auth_timeout"]
|
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