Skip to content

Commit

Permalink
Decode escaped URI chars in the dvSwitch name
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jan 24, 2017
1 parent 1f8cdb1 commit 033776f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,15 @@ def self.host_inv_to_switch_hashes(inv, dvswitch_inv, dvswitch_uid_ems)
dvswitch_inv.to_miq_a.each do |data|
config = data.fetch('config', {})
uid = data['MOR']
name = config['name'] || data.fetch_path('summary', 'name')
security_policy = config.fetch('defaultPortConfig', {}).fetch('securityPolicy', {})
allow_promiscuous = security_policy.fetch_path('allowPromiscuous', 'value')
forged_transmits = security_policy.fetch_path('forgedTransmits', 'value')
mac_changes = security_policy.fetch_path('macChanges', 'value')

dvswitch_uid_ems[uid] || dvswitch_uid_ems[uid] = {
:uid_ems => uid,
:name => config['name'] || data.fetch_path('summary', 'name'),
:name => URI.decode(name),
:ports => config['numPorts'] || 0,

:allow_promiscuous => allow_promiscuous.nil? ? nil : allow_promiscuous.to_s.casecmp('true') == 0,
Expand Down

0 comments on commit 033776f

Please sign in to comment.