Skip to content

Commit

Permalink
Update PowerVS cloud subnet parser
Browse files Browse the repository at this point in the history
- Add AZ relationship
- Save network type to 'extra_attributes' column
  • Loading branch information
jaywcarman committed Oct 8, 2020
1 parent 0fe14dd commit 61d8eec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ def networks
)

persister_cloud_subnet = persister.cloud_subnets.build(
:cloud_network => persister_cloud_networks,
:cidr => network['cidr'],
:ems_ref => network['networkID'],
:gateway => network['gateway'],
:name => network['name'],
:status => "active",
:dns_nameservers => network['dnsServers'],
:ip_version => '4',
:network_protocol => 'IPv4'
:cloud_network => persister_cloud_networks,
:cidr => network['cidr'],
:ems_ref => network['networkID'],
:gateway => network['gateway'],
:name => network['name'],
:status => "active",
:dns_nameservers => network['dnsServers'],
:ip_version => '4',
:network_protocol => 'IPv4',
:availability_zone => persister.availability_zones.lazy_find(persister.cloud_manager.uid_ems),
:network_type => network['type']
)

mac_to_port = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def assert_specific_cloud_network

def assert_specific_cloud_subnet
cloud_subnet = ems.network_manager.cloud_subnets.find_by(:ems_ref => "339fc829-8c70-41dd-84c1-ca4b3a608b88")
expect(cloud_subnet.availability_zone&.ems_ref).to eq(ems.uid_ems)
expect(cloud_subnet).to have_attributes(
:ems_ref => "339fc829-8c70-41dd-84c1-ca4b3a608b88",
:name => "public-192_168_129_72-29-VLAN_2037",
Expand All @@ -149,7 +150,7 @@ def assert_specific_cloud_subnet
:gateway => "192.168.129.73",
:network_protocol => "IPv4",
:dns_nameservers => ["9.9.9.9"],
:extra_attributes => {:ip_version=>"4"},
:extra_attributes => {:ip_version => "4", :network_type => "pub-vlan"},
:type => "ManageIQ::Providers::IbmCloud::PowerVirtualServers::NetworkManager::CloudSubnet"
)
end
Expand Down

0 comments on commit 61d8eec

Please sign in to comment.