When we use voltha-onos docker, onos sends clear_actions instruction to voltha ofagent component. voltha ofagent component doesnt handle this instruction type and creates an exception:
20180124T125506.456 ERROR of_protocol_handler.handle_flow_mod_request
{e: <class 'loxi.of13.instruction.clear_actions'>, event: failed-to-convert, exception: Traceback (most recent call last): File "/ofagent/ofagent/of_protocol_handler.py", line 122, in handle_flow_mod_request grpc_req = to_grpc(req) File "/ofagent/ofagent/converter.py", line 52, in to_grpc return converter(loxi_object) File "/ofagent/ofagent/converter.py", line 244, in loxi_flow_mod_to_ofp_flow_mod instructions=[to_grpc(i) for i in lo.instructions]) File "/ofagent/ofagent/converter.py", line 51, in to_grpc converter = to_grpc_converters[cls] KeyError: <class 'loxi.of13.instruction.clear_actions'>, instance_id: compose_ofagent_1}
As a conclusion, we see the flows at pending_add state when we check them at Onos cli.
Change-Id: Icde46ba15dccaa2d25920d5d5d104baf88bdd22b
diff --git a/ofagent/converter.py b/ofagent/converter.py
index 6855c56..06b31ba 100644
--- a/ofagent/converter.py
+++ b/ofagent/converter.py
@@ -157,6 +157,8 @@
return of13.instruction.apply_actions(
actions=[make_loxi_action(a)
for a in inst['actions']['actions']])
+ elif type == pb2.OFPIT_CLEAR_ACTIONS:
+ return of13.instruction.clear_actions()
elif type == pb2.OFPIT_GOTO_TABLE:
return of13.instruction.goto_table(
table_id=inst['goto_table']['table_id'])
@@ -352,6 +354,10 @@
actions=pb2.ofp_instruction_actions(
actions=[to_grpc(a) for a in lo.actions]))
+def loxi_clear_actions_to_ofp_instruction(lo):
+ return pb2.ofp_instruction(
+ type=pb2.OFPIT_CLEAR_ACTIONS)
+
def loxi_goto_table_to_ofp_instruction(lo):
return pb2.ofp_instruction(
@@ -414,6 +420,7 @@
of13.oxm.metadata: loxi_oxm_metadata_to_ofp_oxm,
of13.instruction.apply_actions: loxi_apply_actions_to_ofp_instruction,
+ of13.instruction.clear_actions: loxi_clear_actions_to_ofp_instruction,
of13.instruction.goto_table: loxi_goto_table_to_ofp_instruction,
of13.action.output: loxi_output_action_to_ofp_action,