Fix nic_alias fact error
If os-net-config is not installed, this fact causes a warning to be
generated. Let's check for os-net-config prior to trying to run it to
cleanup this error.
Change-Id: Ie55b96bbd7b60dae2342b89c24936d4d071cec10
Closes-Bug: #1794837
(cherry picked from commit 6fb8797f79
)
This commit is contained in:
parent
ab15b3468f
commit
123be2924e
|
@ -15,8 +15,13 @@
|
||||||
|
|
||||||
Facter.add('nic_alias') do
|
Facter.add('nic_alias') do
|
||||||
setcode do
|
setcode do
|
||||||
mapping_report =
|
os_net_config = '/usr/bin/os-net-config'
|
||||||
Facter::Core::Execution.execute('/usr/bin/os-net-config -i')
|
mapping_report = ''
|
||||||
mapping_report.delete("{}' ")
|
if File.exist?(os_net_config)
|
||||||
|
mapping_report =
|
||||||
|
Facter::Core::Execution.execute("#{os_net_config} -i")
|
||||||
|
mapping_report.delete("{}' ")
|
||||||
|
end
|
||||||
|
mapping_report
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue