Skip to content

Commit

Permalink
(maint) Updates macOS structured facts
Browse files Browse the repository at this point in the history
This commit updates the structured facts used for macOS, which
previously omitted the 'macosx' level of the hash.
  • Loading branch information
mhashizume committed Mar 7, 2023
1 parent 028e21e commit 27350cd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
6 changes: 3 additions & 3 deletions manifests/osfamily/darwin.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class puppet_agent::osfamily::darwin {
assert_private()

if $facts['os']['version']['major'] =~ /^10\./ {
$productversion_major = $facts['os']['version']['major']
if $facts['os']['macosx']['version']['major'] =~ /^10\./ {
$productversion_major = $facts['os']['macosx']['version']['major']
} else {
$productversion_array = split($facts['os']['version']['major'], '[.]')
$productversion_array = split($facts['os']['macosx']['version']['major'], '[.]')
$productversion_major = $productversion_array[0]
}

Expand Down
36 changes: 24 additions & 12 deletions spec/classes/puppet_agent_osfamily_darwin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
architecture: 'x86_64',
name: 'Darwin',
family: 'Darwin',
version: {
major: '10.13',
macosx: {
version: {
major: '10.13',
},
},
},
servername: 'master.example.vm',
Expand All @@ -50,8 +52,10 @@
aio_agent_version: '1.10.99',
is_pe: true,
os: {
version: {
major: osmajor,
macosx: {
version: {
major: osmajor,
},
},
},
platform_tag: tag,
Expand Down Expand Up @@ -95,8 +99,10 @@
aio_agent_version: '1.10.99',
is_pe: true,
os: {
version: {
major: '10.13',
macosx: {
version: {
major: '10.13',
},
},
},
platform_tag: 'osx-10.13-x86_64',
Expand All @@ -117,8 +123,10 @@
aio_agent_version: '1.10.99',
is_pe: true,
os: {
version: {
major: '10.13',
macosx: {
version: {
major: '10.13',
},
},
},
platform_tag: 'osx-10.13-x86_64',
Expand All @@ -140,8 +148,10 @@
aio_agent_version: '1.10.99',
is_pe: true,
os: {
version: {
major: '11.2',
macosx: {
version: {
major: '11.2',
},
},
},
platform_tag: 'osx-11-x86_64',
Expand All @@ -163,8 +173,10 @@
aio_agent_version: '1.10.99',
is_pe: true,
os: {
version: {
major: '11',
macosx: {
version: {
major: '11',
},
},
},
platform_tag: 'osx-11-x86_64',
Expand Down

0 comments on commit 27350cd

Please sign in to comment.