Sha256: 2eeb4e0cec60eb78ef02ae64eda61e20c8d305e3c5c62bbc3493b95fc53ff2ef

Contents?: true

Size: 1000 Bytes

Versions: 7

Compression:

Stored size: 1000 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Mock class for Network Request
      class Real
        def check_virtual_network_exists(resource_group, name)
          msg = "Checking Virtual Network #{name}"
          Fog::Logger.debug msg
          begin
            @network_client.virtual_networks.get(resource_group, name)
            Fog::Logger.debug "Virtual Network #{name} exists."
            true
          rescue MsRestAzure::AzureOperationError => e
            if e.response.status == '404'
              Fog::Logger.debug "Virtual Network #{name} doesn't exist."
              false
            else
              raise_azure_exception(e, msg)
            end
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def check_virtual_network_exists(resource_group, name)
          Fog::Logger.debug "Virtual Network #{name} from Resource group #{resource_group} is available."
          true
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.5 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb