lib/fog/azurerm/requests/storage/get_container_metadata.rb in fog-azure-rm-0.0.4 vs lib/fog/azurerm/requests/storage/get_container_metadata.rb in fog-azure-rm-0.0.5

- old
+ new

@@ -1,25 +1,26 @@ module Fog module Storage class AzureRM - # This class provides the actual implemention for service calls. + # This class provides the actual implementation for service calls. class Real def get_container_metadata(name) - Fog::Logger.debug "Get Container #{name} metadata." + msg = "Getting Container #{name} metadata." + Fog::Logger.debug msg begin container = @blob_client.get_container_metadata(name) - Fog::Logger.debug "Getting metadata of container #{name} successfully." - container.metadata rescue Azure::Core::Http::HTTPError => ex - raise "Exception in getting metadata of Container #{name}: #{ex.inspect}" + raise_azure_exception(ex, msg) end + Fog::Logger.debug "Getting metadata of container #{name} successfully." + container.metadata end end # This class provides the mock implementation for unit tests. class Mock - def get_container_metadata(name) + def get_container_metadata(*) { - 'container-name' => name, + 'container-name' => 'testcontainer1', 'created-by' => 'User', 'source-machine' => 'Test-machine', 'category' => 'guidance', 'doctype' => 'textDocuments' }