Sha256: 62a7a410075ce05a4cdf4ebd0733b85326202e9d2269bfb965fc4a6e58717018

Contents?: true

Size: 915 Bytes

Versions: 17

Compression:

Stored size: 915 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 !e.body['error'].nil? && e.body['error']['code'] == ERROR_CODE_RESOURCE_NOT_FOUND
              zone = nil
            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

17 entries across 17 versions & 3 rubygems

Version Path
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb