Sha256: 309f114ce484cf258cd1e4cc1e0e6069762f12615906d1ea74556ecd219ee8bd

Contents?: true

Size: 748 Bytes

Versions: 3

Compression:

Stored size: 748 Bytes

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implemention for service calls.
      class Real
        def check_blob_exist(container_name, name, options = {})
          Fog::Logger.debug "Check Blob #{name} exist in container #{container_name}."
          begin
            @blob_client.get_blob_properties(container_name, name, options)
          rescue Azure::Core::Http::HTTPError
            return false
          end
          Fog::Logger.debug "Blob #{name} Exists."
          true
        end
      end
      # This class provides the mock implementation for unit tests.
      class Mock
        def check_blob_exist(*)
          true
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/storage/check_blob_exist.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/storage/check_blob_exist.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/storage/check_blob_exist.rb