diff --git a/src/python/oftest/action_list.py b/src/python/oftest/action_list.py
index 628e067..75c014d 100644
--- a/src/python/oftest/action_list.py
+++ b/src/python/oftest/action_list.py
@@ -112,14 +112,11 @@
 
         @param action The action to add
 
-        @return True if successful, False if not an action object
-
         """
-        if isinstance(action, action_class_list):
-            tmp = copy.deepcopy(action)
-            self.actions.append(tmp)
-            return True
-        return False
+        if not isinstance(action, action_class_list):
+            raise ValueError("%s is not an action" % type(action))
+        self.actions.append(copy.deepcopy(action))
+        return True # for backwards compatibility
 
     def remove_type(self, type):
         """
@@ -163,9 +160,8 @@
 
         """
         for act in other.actions:
-            if not self.add(act):
-                return False
-        return True
+            self.add(act)
+        return True # for backwards compatibility
         
     def __len__(self):
         length = 0
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index 8ee212b..de7b52a 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -535,8 +535,7 @@
     if action_list is not None:
         for act in action_list:
             logging.debug("Adding action " + act.show())
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add action" + act.show())
+            request.actions.add(act)
 
     # Set up output/enqueue action if directed
     if egr_queue is not None:
@@ -545,16 +544,12 @@
         for egr_port in egr_port_list:
             act.port = egr_port
             act.queue_id = egr_queue
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add enqueue action " + 
-                              str(egr_port) + " Q: " + str(egr_queue))
+            request.actions.add(act)
     elif egr_ports is not None:
         for egr_port in egr_port_list:
             act = action.action_output()
             act.port = egr_port
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add output action " + 
-                              str(egr_port))
+            request.actions.add(act)
 
     logging.debug(request.show())
 
@@ -637,14 +632,14 @@
     msg.data = str(pkt)
     if action_list is not None:
         for act in action_list:
-            assert(msg.actions.add(act))
+            msg.actions.add(act)
 
     # Set up output action
     if egr_ports is not None:
         for egr_port in egr_ports:
             act = action.action_output()
             act.port = egr_port
-            assert(msg.actions.add(act))
+            msg.actions.add(act)
 
     logging.debug(msg.show())
     rv = parent.controller.message_send(msg)
