Skip to content

Commit

Permalink
Merge pull request #16318 from gildub/discovery-openstack-infra
Browse files Browse the repository at this point in the history
EMS infra: adds Openstack undercloud discovery
  • Loading branch information
agrare authored Feb 23, 2018
2 parents 4429472 + 5d26d45 commit dd1fd99
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def self.create_discovered_ems(ost)
[ManageIQ::Providers::Microsoft::InfraManager, 'SCVMM']
elsif ost.hypervisor.include?(:rhevm)
[ManageIQ::Providers::Redhat::InfraManager, 'RHEV-M']
elsif ost.hypervisor.include?(:openstack_infra)
[ManageIQ::Providers::Openstack::InfraManager, 'OpenStack Director']
else
[ManageIQ::Providers::Vmware::InfraManager, 'Virtual Center']
end
Expand Down Expand Up @@ -428,7 +430,7 @@ def refresh_ems(opts = {})
end

def self.ems_infra_discovery_types
@ems_infra_discovery_types ||= %w(virtualcenter scvmm rhevm)
@ems_infra_discovery_types ||= %w(virtualcenter scvmm rhevm openstack_infra)
end

def self.ems_physical_infra_discovery_types
Expand Down
2 changes: 1 addition & 1 deletion app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ def self.discoverHost(options)
else
_log.info("Discovered: #{ost_inspect(ost)}")

if [:virtualcenter, :scvmm, :rhevm].any? { |ems_type| ost.hypervisor.include?(ems_type) }
if %i(virtualcenter scvmm rhevm openstack_infra).any? { |ems_type| ost.hypervisor.include?(ems_type) }
ExtManagementSystem.create_discovered_ems(ost)
return # only create ems instance, no host.
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/ext_management_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
end

it ".ems_infra_discovery_types" do
expected_types = %w(scvmm rhevm virtualcenter)
expected_types = %w(scvmm rhevm virtualcenter openstack_infra)

expect(described_class.ems_infra_discovery_types).to match_array(expected_types)
end
Expand Down

0 comments on commit dd1fd99

Please sign in to comment.