Skip to content

Commit

Permalink
Remove region support
Browse files Browse the repository at this point in the history
  • Loading branch information
tumido committed Mar 2, 2018
1 parent 74df0c5 commit 97c6488
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 76 deletions.
7 changes: 0 additions & 7 deletions app/models/manageiq/providers/google/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class ManageIQ::Providers::Google::CloudManager < ManageIQ::Providers::CloudMana
include ManageIQ::Providers::Google::ManagerMixin

supports :provisioning
supports :regions

before_create :ensure_managers
before_update :ensure_managers_zone_and_provider_region
Expand Down Expand Up @@ -58,12 +57,6 @@ def supports_authentication?(authtype)
supported_auth_types.include?(authtype.to_s)
end

validates :provider_region, :inclusion => {:in => ManageIQ::Providers::Google::Regions.names}

def description
ManageIQ::Providers::Google::Regions.find_by_name(provider_region)[:description]
end

# Operations

def vm_start(vm, _options = {})
Expand Down
4 changes: 0 additions & 4 deletions app/models/manageiq/providers/google/network_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def self.hostname_required?
false
end

def description
ManageIQ::Providers::Google::Regions.find_by_name(provider_region)[:description]
end

def self.display_name(number = 1)
n_('Network Provider (Google)', 'Network Providers (Google)', number)
end
Expand Down
60 changes: 0 additions & 60 deletions app/models/manageiq/providers/google/regions.rb

This file was deleted.

7 changes: 2 additions & 5 deletions spec/models/manageiq/providers/google/cloud_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,20 @@
expect(ExtManagementSystem.count).to eq(0)
end

it "moves the network_manager to the same zone and provider region as the cloud_manager" do
it "moves the network_manager to the same zone as the cloud_manager" do
zone1 = FactoryGirl.create(:zone)
zone2 = FactoryGirl.create(:zone)

ems = FactoryGirl.create(:ems_google, :zone => zone1, :provider_region => "us-east1")
ems = FactoryGirl.create(:ems_google, :zone => zone1)
expect(ems.network_manager.zone).to eq zone1
expect(ems.network_manager.zone_id).to eq zone1.id
expect(ems.network_manager.provider_region).to eq "us-east1"

ems.zone = zone2
ems.provider_region = "us-central1"
ems.save!
ems.reload

expect(ems.network_manager.zone).to eq zone2
expect(ems.network_manager.zone_id).to eq zone2.id
expect(ems.network_manager.provider_region).to eq "us-central1"
end

context "#connectivity" do
Expand Down

0 comments on commit 97c6488

Please sign in to comment.