<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I don't understand how this tool gives such unhelpful error messages. It's not supposed to be a guessing game; it should point straight at where the problem is. Running this code with POX using the --verbose option gives this:<div><br></div><div>[pox]$ ./pox.py --verbose tst<br>POX 0.3.0 (dart) / Copyright 2011-2014 James McCauley, et al.<br>Error executing tst.launch:<br>Traceback (most recent call last):<br> File "/Users/murphy/tmp/pox/pox/boot.py", line 243, in _do_launch<br> if f(**params) is False:<br> File "/Users/murphy/tmp/pox/ext/tst.py", line 27, in launch<br> MyCache = VideoCache('IDEALCACHE')<br>TypeError: __init__() takes exactly 3 arguments (2 given)<br><br>Parameters for tst:<br> None.<br><br></div><div>.. which clearly indicates the problem is with calling the __init__() for VideoCache on line 27.</div><div><br></div><div>(Which is a problem because while your VideoCache class takes a connection and a transparent argument -- apparently copied from l2_learning -- you're passing in a single string.)</div><div><br></div><div>-- Murphy</div><div><br><div><div><div>On Apr 29, 2014, at 12:01 PM, kofi adu <<a href="mailto:kofiadubb@yahoo.com">kofiadubb@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt; position: static; z-index: auto;"><div class="" style="font-size: 16px">Hi Murphy</div><div class="" style="font-size: 16px"><br clear="none" class="" style=""></div><div class="" style="background-color: transparent">i am trying to run my program and it gives me this prompt. Is there any help? thanks</div><div class="" style="background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent">i get this error </div><h1 style="font-size: 23px; border: 0px; vertical-align: baseline; line-height: 1.3; font-family: 'Trebuchet MS', 'Liberation Sans', 'DejaVu Sans', sans-serif;"><a rel="nofollow" shape="rect" class="" target="_blank" href="http://stackoverflow.com/questions/9444992/typeerror-init-takes-exactly-3-arguments-2-given" style="border: 0px; vertical-align: baseline; cursor: pointer;"><font>typeerror-init-takes-exactly-3-arguments-2-given</font></a></h1><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"># class </div><div class="" style="font-size: 16px; background-color: transparent">class VideoCache (object):</div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"> </div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"> <span class="" style="white-space:
pre"> </span># Constructor of the class </div><div class="" style="font-size: 16px; background-color: transparent"> def __init__(self, connection, transparent):</div><div class="" style="font-size: 16px; background-color: transparent"> # track the connection to the switch to send messages</div><div class="" style="font-size: 16px; background-color: transparent"> <span class="" style="white-space: pre"> </span>self.connection = connection</div><div class="" style="font-size: 16px; background-color: transparent"> self.transparent = transparent</div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"> # Add listener events to handle connection events from OpenFlow switch </div><div class="" style="font-size: 16px; background-color:
transparent"> connection.addListeners(self)</div><div class="" style="font-size: 16px; background-color: transparent"> log.debug("Initializing VideoCache, transparent=%s", str(self.transparent))</div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size: 16px; background-color: transparent"> # Turn on Nicira packet_ins. </div><div class="" style="font-size: 16px; background-color: transparent"> # Nicira extensions to support openFlow 1.0</div><div class="" style="font-size: 16px; background-color: transparent"> msg = nx.nx_packet_in_format()</div><div class="" style="font-size: 16px; background-color: transparent"> event.connection.send(msg)</div><div class="" style="font-size: 16px; background-color: transparent"><br clear="none" class="" style=""></div><div class="" style="font-size:
16px; background-color: transparent"> # Turn on ability to specify table in flow_mods</div><div class="" style="font-size: 16px; background-color: transparent"> msg = nx.nx_flow_mod_table_id()</div><div class="" style="font-size: 16px; background-color: transparent"><span class="" style="background-color: transparent"> event.connection.send(msg)</span> </div><div class="" style="font-size: 16px; background-color: transparent"><br class="" style=""></div><div class="" style="background-color: transparent"><div class="" style="background-color: transparent"><br></div><div class="" style="background-color: transparent"><br></div><div class="" style="background-color: transparent">the launch function below</div><div class="" style="background-color: transparent"><br></div><div class="" style="background-color: transparent">def launch ():</div><div class="" style="background-color: transparent"><br class="" style=""></div><div class="" style="background-color: transparent"> # create new class object </div><div class="" style="background-color: transparent"> MyCache = VideoCache('IDEALCACHE')</div><div class="" style="background-color: transparent"><br class="" style=""></div><div class="" style="background-color: transparent"> # add this class into the core.</div><div class="" style="background-color: transparent"> core.register("cache", MyCache) </div><div class="" style="background-color: transparent"> </div><div class="" style="background-color: transparent"> </div><div class="" style="background-color: transparent"> log.info("Video cache is running.")</div><div class="" style="background-color: transparent"> </div><div style="font-size: 16px" class=""><br class="" style=""></div></div><div class="" style=""><br style=""></div></div></blockquote></div><br></div></div></body></html>