Sha256: 9c14e32e5d3a249efe8cb7a87640944aca8249c512c96108a4937905756f3bc1

Contents?: true

Size: 920 Bytes

Versions: 21

Compression:

Stored size: 920 Bytes

Contents

module Fog
  module DNS
    class AzureRM
      # Real class for DNS Request
      class Real
        def check_zone_exists(resource_group, name)
          msg = "Getting Zone #{name} from Resource Group #{resource_group}."
          Fog::Logger.debug msg
          begin
            zone = @dns_client.zones.get(resource_group, name)
          rescue MsRestAzure::AzureOperationError => e
            if resource_not_found?(e)
              Fog::Logger.debug "Zone #{name} doesn't exist."
              return false
            else
              raise_azure_exception(e, msg)
            end
          rescue => e
            Fog::Logger.debug e[:error][:code]
          end
          !zone.nil?
        end
      end

      # Mock class for DNS Request
      class Mock
        def check_zone_exists(*)
          Fog::Logger.debug 'Zone name name is available.'
          true
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.6 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.5 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.4 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
far-gem-0.5.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb