@libvirt_conn
def get_dnsmasq_dhcp_lease(conn, vm_name):
 domain_name = ('vagrant_' + vm_name)
 mac_address = get_mac_address(conn, domain_name)
 with open('/var/lib/libvirt/dnsmasq/vagrant-private-dhcp.leases') as leases_file:
  reader = csv.reader(leases_file, delimiter=' ')
  for row in reader:
   (lease_mac, lease_ip, lease_vm_name) = row[1:4]
   if (not ((lease_mac == mac_address) and (lease_vm_name == vm_name))):
    continue
   return lease_ip
 raise NoDHCPLeaseException()

@ libvirt_conn def get_dnsmasq_dhcp_lease ( conn , vm_name ) : domain_name = ( 'vagrant_' + vm_name ) mac_address = get_mac_address ( conn , domain_name ) with open ( '/var/lib/libvirt/dnsmasq/vagrant-private-dhcp.leases' ) as leases_file : reader = csv . reader ( leases_file , delimiter = ' ' ) for row in reader : ( lease_mac , lease_ip , lease_vm_name ) = row [ 1 : 4 ] if ( not ( ( lease_mac == mac_address ) and ( lease_vm_name == vm_name ) ) ) : continue return lease_ip raise NoDHCPLeaseException ( )
in libvirt under 1 .