def network_info
      config_response = conf_file_data
      return config_response unless config_response.successful?

      response = Response.new :code => 0, :data => {}

      interface_pattern = /^ethernet\d+/
      mac_pattern = /(\w\w[:-]\w\w[:-]\w\w[:-]\w\w[:-]\w\w[:-]\w\w)/

      config_response.data.each_pair do |k,v|
        if v =~ mac_pattern
          mac = v
          int = k.scan(interface_pattern).first
          response.data[int] = { 'mac_address' => mac }
          lease_response = Fission::Lease.find_by_mac_address mac
          return lease_response unless lease_response.successful?

          response.data[int]['ip_address'] = nil
          if lease_response.data
            response.data[int]['ip_address'] = lease_response.data.ip_address
          end
        end
      end

      response
    end
def network_info
      config_response = conf_file_data
      return config_response unless config_response.successful?

      response = Response.new :code => 0, :data => {}

      interface_pattern = /^ethernet\d+/
      mac_pattern = /(\w\w[:-]\w\w[:-]\w\w[:-]\w\w[:-]\w\w[:-]\w\w)/

      config_response.data.each_pair do |k,v|
        if v =~ mac_pattern
          mac = v
          int = k.scan(interface_pattern).first
          response.data[int] = { 'mac_address' => mac }
          lease_response = Fission::Lease.find_by_mac_address mac
          return lease_response unless lease_response.successful?

          response.data[int]['ip_address'] = nil
          if lease_response.data
            response.data[int]['ip_address'] = lease_response.data.ip_address
          end
        end
      end

      response
    end
Public: Network information for a VM.  Includes interface name, associated
 MAC address, and IP address (if applicable).

 Examples:

   # if IP addresses are found in the Fusion DHCP lease file
   response = @vm.network_info.data
   # => { 'ethernet0' => { 'mac_address' => '00:0c:29:1d:6a:64',
                           'ip_address'  => '127.0.0.1' },
          'ethernet1' => { 'mac_address' => '00:0c:29:1d:6a:75',
                           'ip_address'  => '127.0.0.2' } }

   # if IP addresses are not found in the Fusion DHCP lease file
   response = @vm.network_info.data
   # => { 'ethernet0' => { 'mac_address' => '00:0c:29:1d:6a:64',
                           'ip_address'  => nil },
          'ethernet1' => { 'mac_address' => '00:0c:29:1d:6a:75',
                           'ip_address'  => nil } }

 Returns a Response with the result.
 If successful, the Response's data attribute will be a Hash with the
 interface identifiers as the keys and the associated MAC address.  If an
 IP address was found in the Fusion DHCP lease file, then it will
 be included.  If an IP address was not found, then the IP address value
 will be nil.  If there are no network interfaces, the Response's data
 attribute will be an empty Hash.
 If there is an error, an unsuccessful Response will be returned.