Skip to content

Commit

Permalink
Merge pull request #31 from tkishel/PUP-8590_convert_fact_symbols_to_…
Browse files Browse the repository at this point in the history
…strings

(PUP-8590) convert facts hash keys from symbols to strings
  • Loading branch information
scshitole committed Dec 11, 2018
2 parents af2f1bc + ad95e85 commit 39b2427
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/puppet/util/network_device/f5/facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def retrieve

def parse_device_facts
facts = {
:operatingsystem => :F5
'operatingsystem' => 'F5'
}

if response = @transport.call('/mgmt/tm/cm/device') and items = response['items']
Expand All @@ -26,30 +26,30 @@ def parse_device_facts
#'group_id',
#'pva_version',
#'uptime',
[ :baseMac,
:chassisId,
:fullPath,
:hostname,
:managementIp,
:marketingName,
:partition,
:platformId,
:timeZone,
:version
[ 'baseMac',
'chassisId',
'fullPath',
'hostname',
'managementIp',
'marketingName',
'partition',
'platformId',
'timeZone',
'version'
].each do |fact|
facts[fact] = result[fact.to_s]
end

# Map F5 names to expected standard names.
facts[:fqdn] = facts[:hostname]
facts[:macaddress] = facts[:baseMac]
facts[:operatingsystemrelease] = facts[:version]
facts[:ipaddress] = facts[:managementIp]
facts[:productname] = facts[:marketingName]

facts[:interfaces] = 'mgmt'
facts[:ipaddress_mgmt] = facts[:ipaddress]
facts[:macaddress_mgmt] = facts[:macaddress]
facts['fqdn'] = facts['hostname']
facts['macaddress'] = facts['baseMac']
facts['operatingsystemrelease'] = facts['version']
facts['ipaddress'] = facts['managementIp']
facts['productname'] = facts['marketingName']

facts['interfaces'] = 'mgmt'
facts['ipaddress_mgmt'] = facts['ipaddress']
facts['macaddress_mgmt'] = facts['macaddress']
return facts
end
end

0 comments on commit 39b2427

Please sign in to comment.