def update_ports(self, port_added=[], port_removed=[]): """RPC to update information of ports on Quantum Server""" LOG.info("update ports: added=%s, removed=%s" % (port_added, port_removed)) try: rpc.call(self.context, topics.PLUGIN, {'method': 'update_ports', 'args': {'topic': topics.AGENT, 'agent_id': self.agent_id, 'datapath_id': self.datapath_id, 'port_added': port_added, 'port_removed': port_removed}}) except Exception as e: LOG.warn("update_ports() failed.") return
def update_ports(self, port_added=[], port_removed=[]): """RPC to update information of ports on Quantum Server""" LOG.info("update ports: added=%s, removed=%s" % (port_added, port_removed)) try: rpc.call( self.context, topics.PLUGIN, { "method": "update_ports", "args": { "topic": topics.AGENT, "agent_id": self.agent_id, "datapath_id": self.datapath_id, "port_added": port_added, "port_removed": port_removed, }, }, ) except Exception as e: LOG.warn("update_ports() failed.") return
def call(self, context, msg, topic=None, version=None, timeout=None): """rpc.call() a remote method. :param context: The request context :param msg: The message to send, including the method and args. :param topic: Override the topic for this message. :param timeout: (Optional) A timeout to use when waiting for the response. If no timeout is specified, a default timeout will be used that is usually sufficient. :param version: (Optional) Override the requested API version in this message. :returns: The return value from the remote method. """ self._set_version(msg, version) return rpc.call(context, self._get_topic(topic), msg, timeout)
def call(self, context, msg, topic=None, version=None, timeout=None): """rpc.call() a remote method. :param context: The request context :param msg: The message to send, including the method and args. :param topic: Override the topic for this message. :param version: (Optional) Override the requested API version in this message. :param timeout: (Optional) A timeout to use when waiting for the response. If no timeout is specified, a default timeout will be used that is usually sufficient. :returns: The return value from the remote method. """ self._set_version(msg, version) msg['args'] = self._serialize_msg_args(context, msg['args']) real_topic = self._get_topic(topic) try: result = rpc.call(context, real_topic, msg, timeout) return self.serializer.deserialize_entity(context, result) except rpc.common.Timeout as exc: raise rpc.common.Timeout(exc.info, real_topic, msg.get('method'))
def call(self, context, msg, topic=None, version=None, timeout=None): """rpc.call() a remote method. :param context: The request context :param msg: The message to send, including the method and args. :param topic: Override the topic for this message. :param version: (Optional) Override the requested API version in this message. :param timeout: (Optional) A timeout to use when waiting for the response. If no timeout is specified, a default timeout will be used that is usually sufficient. :returns: The return value from the remote method. """ self._set_version(msg, version) msg['args'] = self._serialize_msg_args(context, msg['args']) real_topic = self._get_topic(topic) try: result = rpc.call(context, real_topic, msg, timeout) return self.serializer.deserialize_entity(context, result) except rpc.common.Timeout as exc: raise rpc.common.Timeout( exc.info, real_topic, msg.get('method'))