From 5b711a67b69ecdf0834a89bc004317e97326f836 Mon Sep 17 00:00:00 2001 From: tvpartytonight Date: Tue, 18 Jun 2024 12:41:17 -0700 Subject: [PATCH] (FACT-3463) Add server to mountpoint device for AIX Previously, in 6c6ef2d, facter omitted the server from the mountpoint data on AIX; this makes it inconsistent with the mountpoints that facter reports in various other linux flavors. This commit adds it back to the `device` key for AIX mountpoints. --- lib/facter/resolvers/aix/mountpoints.rb | 9 +++++++-- spec/facter/resolvers/aix/mountpoints_spec.rb | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/facter/resolvers/aix/mountpoints.rb b/lib/facter/resolvers/aix/mountpoints.rb index 0d19356b54..08fed52f3c 100644 --- a/lib/facter/resolvers/aix/mountpoints.rb +++ b/lib/facter/resolvers/aix/mountpoints.rb @@ -31,9 +31,14 @@ def read_mount(fact_name) def add_mount_points_fact(line) elem = line.split("\s") - elem.shift unless line[0] == ' ' + if line[0] != ' ' + server = elem.shift + device = "#{server}:#{elem[0]}" + else + device = elem[0] + end - @fact_list[:mountpoints][elem[1]] = { device: elem[0], filesystem: elem[2], + @fact_list[:mountpoints][elem[1]] = { device: device, filesystem: elem[2], options: elem.last.include?(':') ? [] : elem.last.split(',') } end diff --git a/spec/facter/resolvers/aix/mountpoints_spec.rb b/spec/facter/resolvers/aix/mountpoints_spec.rb index 05aa4afbec..0b4ffb31ff 100644 --- a/spec/facter/resolvers/aix/mountpoints_spec.rb +++ b/spec/facter/resolvers/aix/mountpoints_spec.rb @@ -13,7 +13,7 @@ filesystem: 'x', options: ['rw', 'nodev', 'log=/dev/hd3'], size: '206.64 MiB', size_bytes: 216_678_912, used: '1.58 MiB', used_bytes: 1_655_296 }, '/tmp/salam' => { available: '63.57 GiB', available_bytes: 68_253_413_376, capacity: '7.20%', - device: '/var/share', filesystem: 'nfs3', options: [], size: '68.50 GiB', + device: 'joe:/var/share', filesystem: 'nfs3', options: [], size: '68.50 GiB', size_bytes: 73_549_217_792, used: '4.93 GiB', used_bytes: 5_295_804_416 } } end