Hi, Tomonori, In fact I have written 'super(MyApp, self).__init__(*args, 
**kwargs)' in my __init__ function. 
To make it simple, I just add start() in the ryu simple_switch_13.py, like this:

class SimpleSwitch13(app_manager.RyuApp):
    OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]

    def __init__(self, *args, **kwargs):
        super(SimpleSwitch13, self).__init__(*args, **kwargs)
        self.mac_to_port = {}

    def start(self):
        print "HELLO................."
        super(SimpleSwitch13, self).start()

    @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
    def switch_features_handler(self, ev):
        datapath = ev.msg.datapath
        ofproto = datapath.ofproto
        parser = datapath.ofproto_parser
        self.logger.info("datapath in: %s", datapath.address[0])

But I still cannot see the log 'HELLO.............' outputted. So I am 
confused. I run the simple_switch_13.py like this:

root@openflow:/home/workspace/ryu/ryu/app# ryu-manager simple_switch_13.py
loading app simple_switch_13.py
loading app ryu.controller.ofp_handler
instantiating app simple_switch_13.py
instantiating app ryu.controller.ofp_handler
datapath in: 10.10.0.36
datapath in: 10.10.0.35
datapath in: 10.10.0.33
packet in 295606521832913 74:25:8a:bf:22:3d 01:80:c2:00:00:0e 48

Do I miss something ?

Best Regards,
Kun Liu
-------------------------------------------------------------------------------------
From: FUJITA Tomonori [mailto:[email protected]] 
To: LIU, Kun
cc: [email protected]; [email protected]
subject: Re: [Ryu-devel] Fail to trigger start( ) in RYU app

On Thu, 15 May 2014 20:13:33 +0800
"LIU, Kun" <[email protected]> wrote:

> Hi, Spalla, sorry to disturb you again. I still cannot trigger start( ) in my 
> ryu app. I wrote the code like this:
> class MyApp(app_manager.RyuApp):
> def __init__(self):
>     pass
> 
> def start(self):
>     self.logger.info(“run start()!!”)
>     super(MyApp, self).start()
>     # other codes

Try something like the following code:

=
from ryu.base import app_manager

class ExampleApp(app_manager.RyuApp):
    def __init__(self, *args, **kwargs):
        super(ExampleApp, self).__init__(*args, **kwargs)

    def start(self):
        print "hello"
        super(ExampleApp, self).start()
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to