Flavio Leitner <f...@sysclose.org> writes:

> On Wed, May 25, 2016 at 11:08:37AM -0400, Aaron Conole wrote:
>> Flavio Leitner <f...@sysclose.org> writes:
>> > On Tue, May 24, 2016 at 04:35:29PM -0400, Aaron Conole wrote:
> [...] 
>> >> +
>> >> +    ovsdb = OVSDB(db_sock)
>> >> +    if mirror_interface is None:
>> >
>> > mirror_interface is referenced but it hasn't been initialized.
>> 
>> Python :-)  Technically, it's allowed, and flake8 or pyflakes doesn't
>> complain (because it is perfectly valid python).  However, I can
>> rewrite it something like
>> 
>> mirror_interface = None
>> ...
>> mirror_interface = mirror_interface or "mi_%s" % interface
>> 
>> if you think that feels more natural. Doesn't matter to me.
>
> I tried something simple:
>
>    >>> def func():
>    ...     if NotDeclared:
>    ...             pass
>    ... 
>    >>> func()
>    Traceback (most recent call last):
>      File "<stdin>", line 1, in <module>
>      File "<stdin>", line 2, in func
>    NameError: global name 'NotDeclared' is not defined
>    
> and it complains. :-)
> [Python 2.7.11]

Hrrm... no idea why my testing didn't cause it to die then. I'm an idiot
and I'll fix it.

Thanks :-)
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to