Hello M. McCauley , I was indeed adding "routing" instead of "pyrouting".
Thanks you very much for your answer, Tommy Le 4 juil. 2012 17:57, "Murphy McCauley" <[email protected]> a écrit : > The sample_routing application has some dependencies, which are specified > in the meta.json file in the routing directory. Specifically, these are > pyauthenticator and pyrouting. Have you added these dependencies to your > meta.json in tutorial? > > You should also be able to specify these on the commandline. Assuming > you're already putting "pytutorial" or something on the commandline, put > "pyrouting" in front if it. > > Hope that helps. > > -- Murphy > > On Jul 4, 2012, at 2:48 PM, tommy koorevaar wrote: > > > 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 > >
