Sha256: e4bb9fbb6452775ecb6c9f37e373c20af2c685178458d28b8f4774c99f4d1a7b

Contents?: true

Size: 1008 Bytes

Versions: 18

Compression:

Stored size: 1008 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.error_code == 'ResourceNotFound'
              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

18 entries across 18 versions & 3 rubygems

Version Path
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/network/check_virtual_network_exists.rb