Sha256: 569fc904002ea8057444042b0b109e6d50ecdf40b3ec34d0cbaa4354a24eb9c1

Contents?: true

Size: 913 Bytes

Versions: 6

Compression:

Stored size: 913 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Mock class for Network Request
      class Real
        def check_for_virtual_network(resource_group, name)
          msg = "Finding Virtual Network #{name}"
          Fog::Logger.debug msg
          begin
            @network_client.virtual_networks.get(resource_group, name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg) if e.body['error']['code'] == 'ResourceGroupNotFound'
            return false if e.body['error']['code'] == 'ResourceNotFound'
          end
          true
        end
      end

      # Mock class for Network Request
      class Mock
        def check_for_virtual_network(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

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/network/check_for_virtual_network.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/network/check_for_virtual_network.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/network/check_for_virtual_network.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/network/check_for_virtual_network.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/network/check_for_virtual_network.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/requests/network/check_for_virtual_network.rb