Skip to content

Commit

Permalink
Update VCRs for network graph refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
mansam committed Jun 6, 2017
1 parent d7d8e34 commit 4bed4dc
Show file tree
Hide file tree
Showing 12 changed files with 892,622 additions and 130,064 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def parse

def cloud_networks
collector.cloud_networks.each do |n|
status = status = (n.status.to_s.downcase == "active") ? "active" : "inactive"
status = status = n.status.to_s.downcase == "active" ? "active" : "inactive"
network_type_suffix = n.router_external ? "::Public" : "::Private"

network = persister.cloud_networks.find_or_build(n.id)
Expand Down Expand Up @@ -95,7 +95,7 @@ def network_ports

np.fixed_ips.each do |address|
persister.cloud_subnet_network_ports.find_or_build_by(
:address => address["ip_address"],
:address => address["ip_address"],
:cloud_subnet => persister.cloud_subnets.lazy_find(address["subnet_id"]),
:network_port => network_port
)
Expand Down Expand Up @@ -141,7 +141,7 @@ def security_groups
end

def firewall_rule_neutron(rule, security_group)
direction = (rule.direction == "egress") ? "outbound" : "inbound"
direction = rule.direction == "egress" ? "outbound" : "inbound"
firewall_rule = persister.firewall_rules.find_or_build(rule.id)
firewall_rule.resource = security_group
firewall_rule.source_security_group = persister.security_groups.lazy_find(rule.remote_group_id)
Expand All @@ -156,11 +156,11 @@ def firewall_rule_neutron(rule, security_group)
def firewall_rule_nova(rule, security_group)
firewall_rule = persister.firewall_rules.find_or_build(rule.id)
firewall_rule.resource = security_group
firewall_rule.source_security_group = persister.security_groups.lazy_find(collector.security_groups_by_name[rule.group["name"]]),
firewall_rule.direction = "inbound",
firewall_rule.host_protocol = rule.ip_protocol.to_s.upcase,
firewall_rule.port = rule.from_port,
firewall_rule.end_port = rule.to_port,
firewall_rule.source_security_group = persister.security_groups.lazy_find(collector.security_groups_by_name[rule.group["name"]])
firewall_rule.direction = "inbound"
firewall_rule.host_protocol = rule.ip_protocol.to_s.upcase
firewall_rule.port = rule.from_port
firewall_rule.end_port = rule.to_port
firewall_rule.source_ip_range = rule.ip_range["cidr"]
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class ManageIQ::Providers::Openstack::InventoryCollectionDefault::NetworkManager
class << self
def network_ports(extra_attributes = {})
attributes = {
:model_class => ::ManageIQ::Providers::Openstack::NetworkManager::NetworkPort,
:association => :network_ports,
:model_class => ::ManageIQ::Providers::Openstack::NetworkManager::NetworkPort,
:association => :network_ports,
:inventory_object_attributes => [
:type,
:name,
Expand All @@ -30,8 +30,8 @@ def network_ports(extra_attributes = {})

def network_routers(extra_attributes = {})
attributes = {
:model_class => ::ManageIQ::Providers::Openstack::NetworkManager::NetworkRouter,
:association => :network_routers,
:model_class => ::ManageIQ::Providers::Openstack::NetworkManager::NetworkRouter,
:association => :network_routers,
:inventory_object_attributes => [
:type,
:name,
Expand All @@ -51,8 +51,8 @@ def network_routers(extra_attributes = {})

def floating_ips(extra_attributes = {})
attributes = {
:model_class => ManageIQ::Providers::Openstack::NetworkManager::FloatingIp,
:association => :floating_ips,
:model_class => ManageIQ::Providers::Openstack::NetworkManager::FloatingIp,
:association => :floating_ips,
:inventory_object_attributes => [
:type,
:address,
Expand All @@ -70,8 +70,8 @@ def floating_ips(extra_attributes = {})

def cloud_subnets(extra_attributes = {})
attributes = {
:model_class => ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet,
:association => :cloud_subnets,
:model_class => ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet,
:association => :cloud_subnets,
:inventory_object_attributes => [
:type,
:name,
Expand All @@ -98,8 +98,8 @@ def cloud_subnets(extra_attributes = {})

def cloud_networks(extra_attributes = {})
attributes = {
:model_class => ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork,
:association => :cloud_networks,
:model_class => ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork,
:association => :cloud_networks,
:inventory_object_attributes => [
:type,
:name,
Expand All @@ -124,7 +124,7 @@ def cloud_networks(extra_attributes = {})

def firewall_rules(extra_attributes = {})
attributes = {
:manager_ref => [:ems_ref],
:manager_ref => [:ems_ref],
:inventory_object_attributes => [
:resource,
:source_security_group,
Expand All @@ -142,8 +142,8 @@ def firewall_rules(extra_attributes = {})

def security_groups(extra_attributes = {})
attributes = {
:model_class => ManageIQ::Providers::Openstack::NetworkManager::SecurityGroup,
:association => :security_groups,
:model_class => ManageIQ::Providers::Openstack::NetworkManager::SecurityGroup,
:association => :security_groups,
:inventory_object_attributes => [
:type,
:name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
describe ManageIQ::Providers::Openstack::InfraManager::Refresher do
before(:each) do
_guid, _server, zone = EvmSpecHelper.create_guid_miq_server_zone
@ems = FactoryGirl.create(:ems_openstack_infra, :zone => zone, :hostname => "192.168.24.1",
:ipaddress => "192.168.24.1", :port => 5000, :api_version => 'v2',
@ems = FactoryGirl.create(:ems_openstack_infra, :zone => zone, :hostname => "127.0.0.1",
:ipaddress => "127.0.0.1", :port => 5002, :api_version => 'v2',
:security_protocol => 'no-ssl')
@ems.update_authentication(
:default => {:userid => "admin", :password => "b83387e3b93a015a57f23a9262e799db5d0a22f6"})
Expand Down Expand Up @@ -165,9 +165,9 @@ def assert_specific_host
#:manufacturer => "Red Hat",
#:model => "KVM",
#:bios => "seabios-1.7.5-11.el7",
:memory_mb => 8192,
:memory_mb => 6144,
:memory_console => nil,
:disk_capacity => 49,
:disk_capacity => 40,
:cpu_sockets => 1,
:cpu_total_cores => 1,
:cpu_cores_per_socket => 1,
Expand Down
Loading

0 comments on commit 4bed4dc

Please sign in to comment.