Sha256: cf45db151b3538572daf7137d43138ee5bb85fd74304e6de19caa920bd7b5958

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

module Fog
  module AzureRM
    class Storage
      # This class provides the actual implementation for service calls.
      class Real
        def check_container_exists(name)
          msg = "Checking container #{name}."
          Fog::Logger.debug msg
          begin
            get_container_properties(name)
            Fog::Logger.debug "Container #{name} exists."
            true
          rescue Exception => e
            if e.message.include? 'NotFound'
              Fog::Logger.debug "The specified container #{name} does not exist."
              false
            end
          end
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def check_container_exists(*)
          true
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gitlab-fog-azure-rm-2.2.0 lib/fog/azurerm/requests/storage/check_container_exists.rb
gitlab-fog-azure-rm-2.1.0 lib/fog/azurerm/requests/storage/check_container_exists.rb
gitlab-fog-azure-rm-2.0.1 lib/fog/azurerm/requests/storage/check_container_exists.rb
gitlab-fog-azure-rm-2.0.0 lib/fog/azurerm/requests/storage/check_container_exists.rb
gitlab-fog-azure-rm-1.9.1 lib/fog/azurerm/requests/storage/check_container_exists.rb
gitlab-fog-azure-rm-1.9.0 lib/fog/azurerm/requests/storage/check_container_exists.rb