Nomralize component start()/stop()
Also fixed the /schema swagger/rest entry. It did not work
because the 3rdparty protobuf_to_dict library cannot handle
Map fields. Changed the two map fields to a single list
entry.
Change-Id: Ib25a528701b67d58d32451687724c8247da6efa5
diff --git a/ofagent/of_protocol_handler.py b/ofagent/of_protocol_handler.py
index e109782..1c284eb 100644
--- a/ofagent/of_protocol_handler.py
+++ b/ofagent/of_protocol_handler.py
@@ -14,7 +14,7 @@
# limitations under the License.
#
import structlog
-from twisted.internet.defer import inlineCallbacks
+from twisted.internet.defer import inlineCallbacks, returnValue
import loxi.of13 as ofp
from converter import to_loxi, pb2dict, to_grpc
@@ -44,9 +44,11 @@
self.rpc = rpc
@inlineCallbacks
- def run(self):
+ def start(self):
"""A new call is made after a fresh reconnect"""
+ log.debug('starting')
+
try:
# send initial hello message
self.cxn.send(ofp.message.hello())
@@ -67,6 +69,14 @@
except Exception, e:
log.exception('exception', e=e)
+ log.info('started')
+ returnValue(self)
+
+ def stop(self):
+ log.debug('stopping')
+ pass # nothing to do yet
+ log.info('stopped')
+
def handle_echo_request(self, req):
self.cxn.send(ofp.message.echo_reply(xid=req.xid))