-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: broken validation of boolean env vars (#102)
- Loading branch information
Showing
2 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
__author__ = 'Phillipe Smith' | ||
__author_email__ = '[email protected]' | ||
__app__ = 'rundeck_exporter' | ||
__version__ = '2.8.1' | ||
__version__ = '2.8.2' | ||
|
||
# Disable InsecureRequestWarning | ||
requests.urllib3.disable_warnings() | ||
|
@@ -69,7 +69,7 @@ class RundeckMetricsCollector(object): | |
) | ||
args_parser.add_argument('--debug', | ||
help='Enable debug mode', | ||
default=getenv('RUNDECK_EXPORTER_DEBUG', False), | ||
default=literal_eval(getenv('RUNDECK_EXPORTER_DEBUG', 'False')), | ||
action='store_true' | ||
) | ||
args_parser.add_argument('-v', '--version', | ||
|
@@ -91,7 +91,7 @@ class RundeckMetricsCollector(object): | |
dest='no_checks_in_passive_mode', | ||
help='The rundeck_exporter will not perform any checks while the Rundeck host is in passive execution mode', | ||
action='store_true', | ||
default=getenv('RUNDECK_EXPORTER_NO_CHECKS_IN_PASSIVE_MODE', False) | ||
default=literal_eval(getenv('RUNDECK_EXPORTER_NO_CHECKS_IN_PASSIVE_MODE', 'False')) | ||
) | ||
args_parser.add_argument('--threadpool_max_workers', | ||
help='The maximum number of workers in the threadpool to run rundeck_exporter asynchronous checks. Defaults to (number of CPUs) + 4', | ||
|
@@ -114,7 +114,7 @@ class RundeckMetricsCollector(object): | |
args_parser.add_argument('--rundeck.skip_ssl', | ||
dest='rundeck_skip_ssl', | ||
help='Rundeck Skip SSL Cert Validate', | ||
default=literal_eval(getenv('RUNDECK_SKIP_SSL', 'False').capitalize()), | ||
default=literal_eval(getenv('RUNDECK_SKIP_SSL', 'False')), | ||
action='store_true' | ||
) | ||
args_parser.add_argument('--rundeck.api.version', | ||
|
@@ -132,7 +132,7 @@ class RundeckMetricsCollector(object): | |
args_parser.add_argument('--rundeck.projects.executions', | ||
dest='rundeck_projects_executions', | ||
help='Get projects executions metrics', | ||
default=literal_eval(getenv('RUNDECK_PROJECTS_EXECUTIONS', 'False').capitalize()), | ||
default=literal_eval(getenv('RUNDECK_PROJECTS_EXECUTIONS', 'False')), | ||
action='store_true' | ||
) | ||
args_parser.add_argument('--rundeck.projects.executions.filter', | ||
|
@@ -153,7 +153,7 @@ class RundeckMetricsCollector(object): | |
args_parser.add_argument('--rundeck.projects.executions.cache', | ||
dest='rundeck_projects_executions_cache', | ||
help='Cache requests for project executions metrics query', | ||
default=literal_eval(getenv('RUNDECK_PROJECTS_EXECUTIONS_CACHE', 'False').capitalize()), | ||
default=literal_eval(getenv('RUNDECK_PROJECTS_EXECUTIONS_CACHE', 'False')), | ||
action='store_true' | ||
) | ||
args_parser.add_argument('--rundeck.projects.filter', | ||
|
@@ -167,7 +167,7 @@ class RundeckMetricsCollector(object): | |
dest='rundeck_projects_nodes_info', | ||
help='Display Rundeck projects nodes info metrics, currently only the `rundeck_project_nodes_total` metric is available. May cause high CPU load depending on the number of projects', | ||
action='store_true', | ||
default=getenv('RUNDECK_PROJECTS_NODES_INFO', False) | ||
default=literal_eval(getenv('RUNDECK_PROJECTS_NODES_INFO', 'False')) | ||
) | ||
args_parser.add_argument('--rundeck.cached.requests.ttl', | ||
dest='rundeck_cached_requests_ttl', | ||
|
@@ -179,13 +179,13 @@ class RundeckMetricsCollector(object): | |
dest='rundeck_cpu_stats', | ||
help='Show Rundeck CPU usage stats', | ||
action='store_true', | ||
default=getenv('RUNDECK_CPU_STATS', False) | ||
default=literal_eval(getenv('RUNDECK_CPU_STATS', 'False')) | ||
) | ||
args_parser.add_argument('--rundeck.memory.stats', | ||
dest='rundeck_memory_stats', | ||
help='Show Rundeck memory usage stats', | ||
action='store_true', | ||
default=getenv('RUNDECK_MEMORY_STATS', False) | ||
default=literal_eval(getenv('RUNDECK_MEMORY_STATS', 'False')) | ||
) | ||
|
||
args = args_parser.parse_args() | ||
|