def handle(self, request, data):
        # Get the agent name for message
        agent_name = data['agent']
        for choice in self.fields['agent'].choices:
            if choice[0] == data['agent']:
                agent_name = choice[1]
        try:
            api.neutron.add_network_to_dhcp_agent(request, data['agent'],
                                                  data['network_id'])
            msg = agent_name % _('Agent %s was successfully added.')
            messages.success(request, msg)
            return True
        except Exception:
            redirect = reverse('horizon:admin:networks:detail',
                               args=(data['network_id'],))
            msg = _('Failed to add agent %(agent_name)s for '
                    'network %(network)s.') \
                % {'agent_name': agent_name,
                   'network': data['network_name']}
            exceptions.handle(request, msg, redirect=redirect)
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/admin/networks/agents/forms.py/AddDHCPAgent.handle/swapped operands of `%`