[P4-dev] bug in cli/pd_thrift_client.py?

Ronald van der Pol Ronald.vanderPol at rvdp.org
Thu Feb 18 11:21:11 EST 2016


I am trying to run the p4factory/targets/simple_router example.
(git clone of today).

It works fine, except:

$ python ../../cli/pd_cli.py -p simple_router -i p4_pd_rpc.simple_router -s $PWD/tests/pd_thrift:$PWD/../../testutils -m "dump_table forward 0" -c localhost:22222
forward_get_entry() takes exactly 5 arguments (4 given)
Try 'help dump_table' for more information

Looks like a problem in cli/pd_thrift_client.py. The hack below makes
it work, but I am not sure how it is supposed to work.

diff --git a/cli/pd_thrift_client.py b/cli/pd_thrift_client.py
index 0f04795..3956ab1 100644
--- a/cli/pd_thrift_client.py
+++ b/cli/pd_thrift_client.py
@@ -161,7 +161,7 @@ class ThriftClient(object):
     return self.get_get_next_entry_handles_function(table_name)(self._session_handle, self._dev_target.dev_id, entry_handle, n)
 
   def show_entry(self, table_name, entry_handle):
-    return self.get_show_entry_function(table_name)(self._session_handle, self._dev_target.dev_id, entry_handle)
+    return self.get_show_entry_function(table_name)(self._session_handle, self._dev_target.dev_id, entry_handle, 0)
 
	rvdp




More information about the P4-dev mailing list