diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c943d..c6e8ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.2] - 2024-09-11 +### Fixed + +- Issue [#101](https://github.com/phsmith/rundeck_exporter/issues/101), fix broken validation of boolean environment variables. + ## [2.8.1] - 2024-09-01 ### Fixed @@ -303,7 +308,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.1...HEAD +[unreleased]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.2...HEAD +[2.8.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.1...v2.8.2 [2.8.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.8.0...v2.8.1 [2.8.0]: https://github.com/phsmith/rundeck_exporter/compare/v2.7.1...v2.8.0 [2.7.1]: https://github.com/phsmith/rundeck_exporter/compare/v2.7.0...v2.7.1 diff --git a/rundeck_exporter.py b/rundeck_exporter.py index db9184c..043ed5d 100755 --- a/rundeck_exporter.py +++ b/rundeck_exporter.py @@ -27,7 +27,7 @@ __author__ = 'Phillipe Smith' __author_email__ = 'phsmithcc@gmail.com' __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()