Sha256: 1d035e6a55b7a9aace2e3251e8d8632470b07521593e864fb7ac35123d8c0fe1

Contents?: true

Size: 799 Bytes

Versions: 61

Compression:

Stored size: 799 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # 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

61 entries across 61 versions & 5 rubygems

Version Path
fog-azure-rm-0.2.0 lib/fog/azurerm/requests/storage/check_container_exists.rb