On Thu, 20 Sep 2018 17:11:59 +0900,
Rodriguez Felipe wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; iso-8859-1 (quoted-printable)>]
> Hi!
> 
> 
> I'm trying to raise one event for sharing it from one app to another, 
> unfortunately I'm not able to set
> 
> the first app as a event provider (checked when running the app in --verbose 
> mode). I've already done this
> 
> one time with the app 2. Can you help me with this issue?

Have you tried to send_event EventEntryPoint?
With the debug logging turned on, it should report if a event is
delivered or not.

> Code of event file:
> 
> 
> import logging
> from ryu.controller import ofp_event, event
> from ryu.controller import handler
> 
> class EventEntryPointBase(event.EventBase):
>     def __init__(self, dpid):
>         super(EventEntryPointBase, self).__init__()
>         self.dpid = dpid
> 
>     def __str__(self):
>         return '%s<%s>' % (self.__class__.__name__, self.dpid)
> 
> class EventEntryPoint(EventEntryPointBase):
>     def __init__(self, dpid):
>         super(EventEntryPoint, self).__init__(dpid)
> 
> 
> 
> 
> Code of app 1:
> 
> 
> class TransportOperator(app_manager.RyuApp):
>     OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
>     _CONTEXTS = {'wsgi': WSGIApplication}
> 
>     _EVENTS = [pointEvent.EventEntryPoint]
> 
> 
>     def __init__(self, *args, **kwargs):
>         super(TransportOperator, self).__init__(*args, **kwargs)
> 
> 
> .
> 
> .
> 
> .
> 
> .
> 
> Rest of code
> 
> .l
> 
> .
> 
> .
> 
> 
> 
> Code of app 2:
> 
> 
> class SimpleSwitch(app_manager.RyuApp):
>     OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
>     _CONTEXTS = {
>         'dpset': dpset.DPSet
>     }
> 
>     _EVENTS = [tenantEvent.EventTenantHostAdd]
> 
>     def __init__(self, *args, **kwargs):
>         super(SimpleSwitch, self).__init__(*args, **kwargs)
>         self.mac_to_port = {}
>         self.arp_cache = {}
>         self.arp_info = {}
>         self.dpset = kwargs['dpset']
> 
> .
> 
> .
> 
> .
> 
> code
> 
> .
> 
> .
> 
> 
>     @set_ev_cls(pointEvent.EventEntryPoint)
>     def data_switch_handler(self, dpid):
>         value.append(dpid)
>         self.logger.info("An Entry Point has been added")
> 
> 
> 
> Thank you,
> 
> 
> 
> Felipe Rodriguez
> 
> 

--
IWAMOTO Toshihiro


_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to