Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version to 3.6.1 #285

Merged
merged 2 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.6.1
* Revert Unify network ID attribute for Red Hat Satellite

## 3.6.0
* Switch to rbvmomi2 (#281)
* Raise the minimum Ruby version to 2.7 (#280)
Expand Down
6 changes: 3 additions & 3 deletions lib/fog/vsphere/requests/compute/get_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ def choose_finder(ref_or_name, distributedswitch)
# only the one will do
proc do |n|
n._ref == ref_or_name || (
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name) &&
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name) &&
(n.config.distributedVirtualSwitch.name == distributedswitch)
)
end
when :dvs
# the first distributed virtual switch will do - selected by network - gives control to vsphere
proc do |n|
n._ref == ref_or_name || (
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name)
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name)
)
end
else
# the first matching network will do, seems like the non-distributed networks come first
proc { |n| n._ref == ref_or_name || n.name == ref_or_name }
proc { |n| n._ref == ref_or_name || n.name == ref_or_name || (n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && n.key == ref_or_name) }
end
end
end
Expand Down
14 changes: 8 additions & 6 deletions lib/fog/vsphere/requests/compute/list_networks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ def list_networks(filters = {})
virtualswitch: dvswitches[network['config.distributedVirtualSwitch']._ref]
)
elsif network.obj.is_a?(RbVmomi::VIM::OpaqueNetwork)
map_attrs_to_hash(network, network_attribute_mapping).merge(
map_attrs_to_hash(network, network_dvportgroup_attribute_mapping).merge(
id: network.obj._ref,
opaqueNetworkId: network.obj.summary.opaqueNetworkId
)
else
map_attrs_to_hash(network, network_attribute_mapping)
map_attrs_to_hash(network, network_attribute_mapping).merge(
id: network.obj._ref
)
end.merge(
_ref: network.obj._ref,
id: managed_obj_id(network.obj),
datacenter: datacenter_name
datacenter: datacenter_name,
_ref: network.obj._ref
)
end.compact
end
Expand All @@ -54,7 +56,7 @@ def network_attribute_mapping

def network_dvportgroup_attribute_mapping
network_attribute_mapping.merge(
dvp_uuid: 'config.key'
id: 'config.key'
)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fog/vsphere/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fog
module Vsphere
VERSION = '3.6.0'.freeze
VERSION = '3.6.1'.freeze
end
end