fix: set service argparse default to None to respect anyconfig map (#31)

This commit is contained in:
Robert Kaussow 2021-07-25 16:01:23 +02:00 committed by GitHub
parent 9301d7088f
commit c6b1d3b9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -13,14 +13,14 @@ PROMETHEUS_PVE_SD_LOG_LEVEL=warning
# supported log formats: console|json|simple
PROMETHEUS_PVE_SD_LOG_FORMAT=console
METRICS_ENABLED=true
METRICS_ADDRESS=127.0.01
METRICS_PORT=8000
PROMETHEUS_PVE_SD_METRICS_ENABLED=true
PROMETHEUS_PVE_SD_METRICS_ADDRESS=127.0.01
PROMETHEUS_PVE_SD_METRICS_PORT=8000
PROMETHEUS_PVE_SD_OUTPUT_FILE=
PROMETHEUS_PVE_SD_LOOP_DELAY=300
# Run pve sd in a loop and discover hosts every n seconds (as defined in PROMETHEUS_PVE_SD_LOOP_DELAY).
# Run PVE SD in a loop and discover hosts every n seconds (as defined in PROMETHEUS_PVE_SD_LOOP_DELAY).
# Can be disabled to run disovery only once.
PROMETHEUS_PVE_SD_SERVICE=true

View File

@ -74,7 +74,11 @@ class PrometheusSD:
help="delay between discovery runs"
)
parser.add_argument(
"--no-service", dest="service", action="store_false", help="run discovery only once"
"--no-service",
dest="service",
action="store_false",
default=None,
help="run discovery only once"
)
parser.add_argument(
"-f",