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
This commit is contained in:
parent
7edd77522a
commit
6fb8797f79
@ -15,8 +15,13 @@
|
||||
|
||||
Facter.add('nic_alias') do
|
||||
setcode do
|
||||
mapping_report =
|
||||
Facter::Core::Execution.execute('/usr/bin/os-net-config -i')
|
||||
mapping_report.delete("{}' ")
|
||||
os_net_config = '/usr/bin/os-net-config'
|
||||
mapping_report = ''
|
||||
if File.exist?(os_net_config)
|
||||
mapping_report =
|
||||
Facter::Core::Execution.execute("#{os_net_config} -i")
|
||||
mapping_report.delete("{}' ")
|
||||
end
|
||||
mapping_report
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user