Thanks, that works! I import pox.openflow.libopenflow_01 as of and my
problem is fixed.

Cheers,
Alison

On Fri, Oct 11, 2013 at 9:47 AM, Murphy McCauley
<[email protected]> wrote:
> I think this is an annoyance caused by the fact that things can be imported 
> by multiple names...
>
> import pox.openflow.libopenflow_01 as of1
> import openflow.libopenflow_01 as of2
> assert of1.ofp_match is of2.ofp_match
> assert of1 is of2
>
> These asserts will fail.  If both had imported the same name (both with or 
> both without the leading "pox."), of1 and of2 would be the same module and 
> the assertions would pass.  But since the names are different, you get two 
> copies of the module instead.  The objects in them are all different (but the 
> same ;) ).
>
> Long story short: the imports in POX all (hopefully) use the full name 
> (including the leading "pox."), so you should do the same.
>
> -- Murphy
>
> On Oct 10, 2013, at 9:03 AM, Alison Chan <[email protected]> wrote:
>
>> Hello,
>>
>> When I start up pox with just the py module and try to concoct a flow
>> and push it manually, the assert isinstance(data, of.ofp_header) in
>> openflow.of_01.Connection.send() fails (but when I manually check
>> it.... it succeeds!). I'm using mininet and the latest carp (just
>> pulled yesterday).
>>
>> The following are my pox session and mininet command line. I'm running
>> mininet in the packaged vm, and pox on my Ubuntu 12.04 laptop. The
>> mininet topology I am using is here:
>> https://gist.github.com/alis0nc/6920762
>>
>> Any help or ideas would be greatly appreciated.
>>
>> Ta,
>> Alison
>>
>> mininet@mininet-vm:~$ sudo mn --custom mininet/custom/stuff.py --topo
>> alison --controller=remote,ip=192.168.56.1,port=6633
>>
>> [11:39:55] erinacity:~/Code/pox
>> alisonc $ ./pox.py py
>> POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
>> INFO:core:POX 0.2.0 (carp) is up.
>> Ready.
>> POX> INFO:openflow.of_01:[00-00-00-00-00-05 1] connected
>>
>> POX>
>> POX>
>> POX>
>> POX> import openflow.libopenflow_01 as of
>> POX> msg = of.ofp_flow_mod()
>> POX> msg.priority  = 42
>> POX> msg.match.in_port = 1
>> POX> msg.actions.append(of.ofp_action_output(port = 2))
>> POX> msg.actions.append(of.ofp_action_output(port = 3))
>> POX> msg.actions.append(of.ofp_action_output(port = 4))
>> POX> core.openflow.connections[5].send(msg)
>> Traceback (most recent call last):
>>  File "<console>", line 1, in <module>
>>  File "/home/alisonc/Code/pox/pox/openflow/of_01.py", line 691, in send
>>    assert isinstance(data, of.ofp_header)
>> AssertionError
>> POX> core.openflow
>> <pox.openflow.OpenFlowNexus object at 0x17399d0>
>> POX> core.openflow.connections[5]
>> <pox.openflow.of_01.Connection object at 0x16db790>
>> POX> type(msg)
>> <class 'openflow.libopenflow_01.ofp_flow_mod'>
>> POX> isinstance(msg, of.ofp_header)
>> True
>> POX>
>>
>>
>> --
>> Alison Chan
>> [email protected]
>> Kettering University
>> Research Assistant, Department of Computer Science
>> +1 909 278 7753
>>
>> Sedulously eschew obfuscatory hyperverbosity or prolixity.
>



-- 
Alison Chan
[email protected]
+1 909 278 7753

Sedulously eschew obfuscatory hyperverbosity or prolixity.

Reply via email to