From a747e3b77a33476d6847937fdc7b442956157be6 Mon Sep 17 00:00:00 2001 From: Tomas Coufal Date: Fri, 2 Mar 2018 14:58:14 +0100 Subject: [PATCH] Remove region support --- .../providers/google/cloud_manager.rb | 7 --- .../providers/google/network_manager.rb | 4 -- .../manageiq/providers/google/regions.rb | 55 ------------------- 3 files changed, 66 deletions(-) delete mode 100644 app/models/manageiq/providers/google/regions.rb diff --git a/app/models/manageiq/providers/google/cloud_manager.rb b/app/models/manageiq/providers/google/cloud_manager.rb index b0f8a238..fd406807 100644 --- a/app/models/manageiq/providers/google/cloud_manager.rb +++ b/app/models/manageiq/providers/google/cloud_manager.rb @@ -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 @@ -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 = {}) diff --git a/app/models/manageiq/providers/google/network_manager.rb b/app/models/manageiq/providers/google/network_manager.rb index f3b39284..957dad92 100644 --- a/app/models/manageiq/providers/google/network_manager.rb +++ b/app/models/manageiq/providers/google/network_manager.rb @@ -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 diff --git a/app/models/manageiq/providers/google/regions.rb b/app/models/manageiq/providers/google/regions.rb deleted file mode 100644 index ac09a7dc..00000000 --- a/app/models/manageiq/providers/google/regions.rb +++ /dev/null @@ -1,55 +0,0 @@ -module ManageIQ - module Providers::Google - module Regions - # From https://cloud.google.com/compute/docs/zones - REGIONS = { - "us-east1" => { - :name => "us-east1", - :hostname => "us-east1", - :description => "Eastern US", - }, - "us-central1" => { - :name => "us-central1", - :hostname => "us-central1", - :description => "Central US", - }, - "europe-west1" => { - :name => "europe-west1", - :hostname => "europe-west1", - :description => "Western Europe", - }, - "asia-east1" => { - :name => "asia-east1", - :hostname => "asia-east1", - :description => "East Asia", - }, - } - - # TODO(lwander): hack to make GCE more compatible with other providers - REGIONS_BY_HOSTNAME = - REGIONS.values.each_with_object({}) do |v, h| - h[v[:hostname]] = v - end - - def self.all - REGIONS.values - end - - def self.names - REGIONS.keys - end - - def self.hostnames - REGIONS_BY_HOSTNAME.keys - end - - def self.find_by_name(name) - REGIONS[name] - end - - def self.find_by_hostname(hostname) - REGIONS_BY_HOSTNAME[hostname] - end - end - end -end