Copy actions put on lists
Prior to adding an action to a list, do a deep copy of it.
This allows the caller to update the action object without
affecting the actions already on the list.
diff --git a/src/python/oftest/action_list.py b/src/python/oftest/action_list.py
index 99786f9..628e067 100644
--- a/src/python/oftest/action_list.py
+++ b/src/python/oftest/action_list.py
@@ -4,6 +4,7 @@
from action import *
from cstruct import ofp_header
+import copy
# # Map OFP action identifiers to the actual structures used on the wire
# action_object_map = {
@@ -115,7 +116,8 @@
"""
if isinstance(action, action_class_list):
- self.actions.append(action)
+ tmp = copy.deepcopy(action)
+ self.actions.append(tmp)
return True
return False