

def get_mac_addresses(self, instance):
    compute_node = getattr(instance, nova_compute.INSTANCE_HOST_ATTRIBUTE)
    libvirt_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
    ssh_attempts = self.config.migrate.ssh_connection_attempts
    with settings(host_string=self.config.ssh_host, connection_attempts=ssh_attempts):
        with forward_agent(env.key_filename):
            cmd = ("virsh dumpxml %s | grep 'mac address' | cut -d\\' -f2" % libvirt_name)
            out = run(('ssh -oStrictHostKeyChecking=no %s %s' % (compute_node, cmd)))
            mac_addresses = out.split()
    mac_iter = iter(mac_addresses)
    return mac_iter

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/network/nova_network.py NovaNetwork.get_mac_addresses/original