Sha256: ee2b200b951e1dc033434a6680cae920d9d2f4890b943da51f1c86b1f99d2ed8

Contents?: true

Size: 758 Bytes

Versions: 8

Compression:

Stored size: 758 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
            raise_azure_exception(e, msg)
          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

8 entries across 8 versions & 1 rubygems

Version Path
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.5 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/requests/dns/check_zone_exists.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/requests/dns/check_zone_exists.rb