Hi Murphy,
 no, I did not check others thoroughly, I was quite happy to figure out why
the heck I am not receiving errors. And yes, I think it would be much nicer
if the handlers are checked. At least the default handler should log an
warning about unhandled event.

>From code perspective, I think the best would be
1) log warnings if there is a message but no handler present
2) use a metaclass which would verify the handlers correspond to correct
messages.

Peter


On Tue, Jun 3, 2014 at 11:22 PM, Murphy McCauley <murphy.mccau...@gmail.com>
wrote:

> Thanks, Peter!  I was a little bit worried about this at the time when
> Denis and I did it.  There was a note in the code about the mismatch of
> BARRIER_REPLY, but not ERROR.
>
> Have you, by chance, checked that the rest of the handlers are hooked up
> okay? :)
>
> (As a sidenote, I actually think we should probably rewrite this to work
> the other direction... map from the handler names to the message types, and
> have it be an error if there's no mapping.  This seems like it would be a
> lot more robust.  We could do it by just scanning globals(), which is sort
> of gross but I'd be okay with it for now, or using a decorator on the
> handlers...)
>
> -- Murphy
>
>
> On Jun 3, 2014, at 9:17 AM, Peter Peresini <peter.peres...@epfl.ch> wrote:
>
> Hi Murphy,
>  apparently recent refactorings in Dart branch broke ErrorIn events (they
> were no longer called because the handler was handler was not recognized),
> here is the fix.
>
> Peter
>
>
>
> From c11bd9c354b8fa6262133c096b7e6a36b6457b85 Mon Sep 17 00:00:00 2001
> From: Peter Peresini <peter.peres...@gmail.com>
> Date: Tue, 3 Jun 2014 18:14:25 +0200
> Subject: [PATCH] Fix wrong name of error handler
>
> ---
>  pox/openflow/of_01.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pox/openflow/of_01.py b/pox/openflow/of_01.py
> index 5a66722..e21663a 100644
> --- a/pox/openflow/of_01.py
> +++ b/pox/openflow/of_01.py
> @@ -188,7 +188,7 @@ class DefaultOpenFlowHandlers (OpenFlowHandlers):
>        con.raiseEventNoErrors(PacketIn, con, msg)
>
>    @staticmethod
> -  def handle_ERROR_MSG (con, msg): #A
> +  def handle_ERROR (con, msg): #A
>      err = ErrorIn(con, msg)
>      e = con.ofnexus.raiseEventNoErrors(err)
>      if e is None or e.halt != True:
> --
> 1.8.3.2
>
>
>
>
>

Reply via email to