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