Skip to content

Commit

Permalink
Use segmentId for dvpg ref if backing is nsx
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jan 28, 2022
1 parent 1d3c499 commit d287632
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ def parse_distributed_virtual_portgroup(object, kind, props)
def parse_portgroups_internal(object, props)
return if Array.wrap(props[:tag]).detect { |tag| tag.key == "SYSTEM/DVS.UPLINKPG" }

ref = object._ref
backing_type, segment_id = props[:config]&.values_at(:backingType, :segmentId)
ref = if backing_type == "nsx" && segment_id.present?
segment_id.split('/').last
else
object._ref
end

uid = props.fetch_path(:config, :key)
name = props.fetch_path(:summary, :name) || props.fetch_path(:config, :name)
name = CGI.unescape(name) unless name.nil?
Expand Down
6 changes: 6 additions & 0 deletions config/property_specs/ems_inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@ base: &base
"6.7":
:VirtualMachine:
- config.createDate
"7.0":
:VirtualMachine:
- config.createDate
:DistributedVirtualPortgroup:
- config.backingType
- config.segmentId

0 comments on commit d287632

Please sign in to comment.