Skip to content

Move Seg6Action default mode assignment to before it is checked

Simon Redman requested to merge seg6-mode into master

When trying to construct a Seg6Action, like:

Seg6Action(segments=actions.actions_fields['srv6_dst'])

Line 171 raises an exception because mode is not specified: https://gitlab.flux.utah.edu/safeedge/nlsdn/blob/master/src/nlsdn/server/sdn.py#L171

But then, a few lines later, it assigns a default value: https://gitlab.flux.utah.edu/safeedge/nlsdn/blob/master/src/nlsdn/server/sdn.py#L177

This patch moves the default value assignment to before the value is checked; a non-default, valid value will persist while a non-default, invalid value will still raise an exception

Edited by Simon Redman

Merge request reports