From c50f12f0146d1fa3e5ee512ce4a9c4d2c6826b8e Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Wed, 13 Sep 2023 21:10:59 -0400 Subject: [PATCH] Check if CONFIG_FILE is defined --- lib/foreman_maintain/config.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/foreman_maintain/config.rb b/lib/foreman_maintain/config.rb index ffd54799d..794fe74de 100644 --- a/lib/foreman_maintain/config.rb +++ b/lib/foreman_maintain/config.rb @@ -64,7 +64,11 @@ def load_config end def config_file_path - File.exist?(CONFIG_FILE) ? CONFIG_FILE : File.join(source_path, 'config/foreman_maintain.yml') + if defined?(CONFIG_FILE) && File.exist?(CONFIG_FILE) + CONFIG_FILE + else + File.join(source_path, 'config/foreman_maintain.yml') + end end def source_path