'Enables hairpin mode for this guest.'

def enable_hairpin(self):

    interfaces = self.get_interfaces()
    try:
        for interface in interfaces:
            utils.execute('tee', ('/sys/class/net/%s/brport/hairpin_mode' % interface), process_input='1', run_as_root=True, check_exit_code=[0, 1])
    except Exception:
        with excutils.save_and_reraise_exception():
            LOG.error('Error    enabling    hairpin    mode    with    XML:    %s', self._encoded_xml, errors='ignore')
