Hello,

I have trouble using the get_route method.

i have tried to do what's done in samplerouting.py :

 in init :

    def __init__(self, ctxt):
        Component.__init__(self, ctxt)
self.routing = None

in install :

    def install(self):
self.routing = self.resolve(pyrouting.PyRouting)

then i create a route in order to test the get_route method :

    myroute = pyrouting.Route()
        myroute.id.src = netinet.create_datapathid_from_host(5)
        myroute.id.dst = netinet.create_datapathid_from_host(10)

however the code runs into an error when i try to access the get_route
method :

00203|pyrt|ERR:unable to invoke a Python event handler:
Traceback (most recent call last):
  File "./nox/lib/util.py", line 116, in f
    event.total_len, buffer_id, packet)
  File "./nox/coreapps/tutorial/pytutorial.py", line 222, in
packet_in_callback
    print "get_route : " , self.routing.get_route(myroute)
AttributeError: 'NoneType' object has no attribute 'get_route'


I would greatly appreciate if i could have more info about how to use the
routing methods, or if some examples are available somewhere. Also if you
have an idea on what could create my problem.

Thank you in advance,
Tom

Reply via email to