Sha256: 7edab6774370d4e4602a9dd887acb9bea7c5a880d6e50776adf59aad810db1c8
Contents?: true
Size: 1.24 KB
Versions: 24
Compression:
Stored size: 1.24 KB
Contents
module Fog module Storage class AzureRM # This class provides the actual implementation for service calls. class Real def check_storage_account_exists(resource_group_name, storage_account_name) msg = "Checking Storage Account: #{storage_account_name}." Fog::Logger.debug msg begin storage_account = @storage_mgmt_client.storage_accounts.get_properties(resource_group_name, storage_account_name) rescue MsRestAzure::AzureOperationError => e if e.body['error']['code'] == 'ResourceNotFound' Fog::Logger.debug "Storage Account #{storage_account_name} doesn't exist." return false else raise_azure_exception(e, msg) end end if storage_account.provisioning_state == 'Succeeded' Fog::Logger.debug "Storage Account #{storage_account_name} exists." true else Fog::Logger.debug "Storage Account #{storage_account_name} doesn't exist." false end end end # This class provides the mock implementation. class Mock def check_storage_account_exists(*) true end end end end end
Version data entries
24 entries across 24 versions & 3 rubygems