diff --git a/CHANGELOG.md b/CHANGELOG.md index c61b14e..986b1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.34.1 / 2024-12-17 +* Fixed: + * Error when no domain is set (#222) + ### 1.34.0 / 2024-09-17 * Fixed: * Legacy fact usage diff --git a/lib/simp/beaker_helpers.rb b/lib/simp/beaker_helpers.rb index 90b3404..c5260ad 100644 --- a/lib/simp/beaker_helpers.rb +++ b/lib/simp/beaker_helpers.rb @@ -723,10 +723,10 @@ def linux_errata( suts ) os_info = fact_on(sut, 'os') # Make sure we have a domain on our host - current_domain = fact_on(sut, 'networking.domain').strip + current_domain = fact_on(sut, 'networking.domain')&.strip hostname = fact_on(sut, 'networking.hostname').strip - if current_domain.empty? + if current_domain.nil? || current_domain.empty? new_fqdn = hostname + '.beaker.test' safe_sed(sut, 's/#{hostname}.*/#{new_fqdn} #{hostname}/', '/etc/hosts') @@ -744,9 +744,8 @@ def linux_errata( suts ) end end - if fact_on(sut, 'networking.domain').strip.empty? - fail("Error: hosts must have an FQDN, got domain='#{current_domain}'") - end + current_domain = fact_on(sut, 'networking.domain')&.strip + fail("Error: hosts must have an FQDN, got domain='#{current_domain}'") if current_domain.nil? || current_domain.empty? # This may not exist in docker so just skip the whole thing if sut.file_exist?('/etc/ssh') diff --git a/lib/simp/beaker_helpers/version.rb b/lib/simp/beaker_helpers/version.rb index 69f5ca3..11a3077 100644 --- a/lib/simp/beaker_helpers/version.rb +++ b/lib/simp/beaker_helpers/version.rb @@ -3,5 +3,5 @@ module Simp; end module Simp::BeakerHelpers - VERSION = '1.34.0' + VERSION = '1.34.1' end