Skip to content

Commit

Permalink
Merge pull request #184 from lpichler/return_empty_for_cloud_tenants
Browse files Browse the repository at this point in the history
Return empty AR relation instead of nil for ::InfraManager#cloud_tenants
(cherry picked from commit 37acd49)
  • Loading branch information
aufi authored and simaishi committed Jan 4, 2018
1 parent 4bdd3c5 commit 8c59c3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/manageiq/providers/openstack/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def availability_zones
end

def cloud_tenants
self.class.none
end

def host_aggregates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,10 @@
expect(ems.supported_catalog_types).to eq(%w(openstack))
end
end

let(:openstack_infra_manager) { FactoryGirl.create(:ems_openstack_infra_with_authentication) }

it 'returns empty relation instead of nil when cloud_tenants are requested on infra provider' do
expect(openstack_infra_manager.cloud_tenants).to eq(ManageIQ::Providers::Openstack::InfraManager.none)
end
end

0 comments on commit 8c59c3a

Please sign in to comment.