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
|
||||
setcode do
|
||||
os_net_config = '/usr/bin/os-net-config'
|
||||
mapping_report = ''
|
||||
if File.exist?(os_net_config)
|
||||
mapping_report =
|
||||
Facter::Core::Execution.execute('/usr/bin/os-net-config -i')
|
||||
Facter::Core::Execution.execute("#{os_net_config} -i")
|
||||
mapping_report.delete("{}' ")
|
||||
end
|
||||
mapping_report
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue