From eb007971b0d0e7682304d5189aacb11f70286f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnar=C3=B6k?= Date: Thu, 25 Apr 2024 09:56:39 -0700 Subject: [PATCH] Make this weird case a fatal error rather. I don't think this code is reachable in normal circumstances, Scott pointed out that it could be a result of a change in CLI output or localization differences in output. With that in mind, it makes more sense to error in these cases since if the package is installed but at an unknowable version we should stop and make the user figure it out. --- recipes/jenkins.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/jenkins.rb b/recipes/jenkins.rb index e6f5917..2fad1cb 100644 --- a/recipes/jenkins.rb +++ b/recipes/jenkins.rb @@ -50,7 +50,8 @@ version_line = jenkins_info.lines.select{|line| line =~ /^Version: /}.first if version_line.nil? - return false + Chef::Log.fatal("Could not determine Jenkins version from dpkg but it does seem installed.") + raise end # Transform "Version: 2.319.1\n" to ["2", "319", "1"]