def send_proxied_message(self, proxy_address, msg): self.log.debug('sending-proxied-message', msg=msg) if isinstance(msg, Packet): msg = str(msg) if self.pon_agent is not None: pon_id, onu_id = self._proxy_address_to_pon_onu_id(proxy_address) pon = self.southbound_ports.get(pon_id) if pon is not None and pon.enabled: onu = pon.onu(onu_id) if onu is not None and onu.enabled: data = AdtranZmqClient.encode_omci_message(msg, pon_id, onu_id, self.is_async_control) try: self.pon_agent.send(data) except Exception as e: self.log.exception('pon-agent-send', pon_id=pon_id, onu_id=onu_id, e=e) else: self.log.debug('onu-invalid-or-disabled', pon_id=pon_id, onu_id=onu_id) else: self.log.debug('pon-invalid-or-disabled', pon_id=pon_id)
def send_proxied_message(self, proxy_address, msg): self.log.debug('sending-proxied-message', msg=msg) if isinstance(msg, Packet): msg = str(msg) if self.zmq_client is not None: pon_id, onu_id = self._proxy_address_to_pon_onu_id(proxy_address) pon = self.southbound_ports.get(pon_id) if pon is not None and pon.enabled: onu = pon.onu(onu_id) if onu is not None and onu.enabled: data = AdtranZmqClient.encode_omci_message( msg, pon_id, onu_id) try: self.zmq_client.send(data) except Exception as e: self.log.exception('zmqClient-send', pon_id=pon_id, onu_id=onu_id, e=e) else: self.log.debug('onu-invalid-or-disabled', pon_id=pon_id, onu_id=onu_id) else: self.log.debug('pon-invalid-or-disabled', pon_id=pon_id)
def send_proxied_message(self, proxy_address, msg): self.log.debug('sending-proxied-message', msg=msg) if isinstance(msg, Packet): msg = str(msg) if self.zmq_client is not None: pon_id = self._channel_id_to_pon_id(proxy_address.channel_id, proxy_address.onu_id) onu_id = proxy_address.onu_id data = AdtranZmqClient.encode_omci_message(msg, pon_id, onu_id) try: self.zmq_client.send(data) except Exception as e: self.log.exception('zmqClient.send', e=e) raise
def send_proxied_message(self, proxy_address, msg): self.log.info('sending-proxied-message: message type: {}'.format( type(msg))) if isinstance(msg, Packet): msg = str(msg) if self.zmq_client is not None: pon_id = self._channel_id_to_pon_id(proxy_address.channel_id, proxy_address.onu_id) onu_id = proxy_address.onu_id data = AdtranZmqClient.encode_omci_message(msg, pon_id, onu_id) try: self.zmq_client.send(data) except Exception as e: self.log.info('zmqClient.send exception', exc=str(e)) raise