Sha256: 0a1973ee95315f8b71216a76365e4f9083d7fa40b9accc06002ce6bee75a3840

Contents?: true

Size: 849 Bytes

Versions: 1

Compression:

Stored size: 849 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Mock class for Network Request
      class Real
        def check_for_virtual_network(name, resource_group)
          begin
            promise = @network_client.virtual_networks.get(resource_group, name)
            promise.value!
            return true
          rescue MsRestAzure::AzureOperationError => e
            msg = "Exception checking name availability: #{e.body['error']['message']}"
            raise msg if e.body['error']['code'] == 'ResourceGroupNotFound'
            return false if e.body['error']['code'] == 'ResourceNotFound'
            return true
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def check_for_virtual_network(_name, _resource_group)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.0 lib/fog/azurerm/requests/network/check_for_virtual_network.rb