Skip to content

Commit

Permalink
Fix general CloudNetwork class_by_ems method
Browse files Browse the repository at this point in the history
  • Loading branch information
tzumainn committed Mar 24, 2017
1 parent 6583ee8 commit 0336d72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/models/cloud_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ class CloudNetwork < ApplicationRecord

virtual_total :total_vms, :vms, :uses => :vms

def self.class_by_ems(ext_management_system, external = false)
def self.class_by_ems(ext_management_system, _external = false)
# TODO: A factory on ExtManagementSystem to return class for each provider
if external
ext_management_system && ext_management_system.class::CloudNetwork::Public
else
ext_management_system && ext_management_system.class::CloudNetwork::Private
end
ext_management_system && ext_management_system.class::CloudNetwork
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ class ManageIQ::Providers::Openstack::NetworkManager::CloudNetwork < ::CloudNetw
require_nested :Private
require_nested :Public

def self.class_by_ems(ext_management_system, external = false)
# TODO: A factory on ExtManagementSystem to return class for each provider
if external
ext_management_system && ext_management_system.class::CloudNetwork::Public
else
ext_management_system && ext_management_system.class::CloudNetwork::Private
end
end

def self.remapping(options)
new_options = options.dup
new_options[:router_external] = options[:external_facing] if options[:external_facing]
Expand Down

0 comments on commit 0336d72

Please sign in to comment.