[P4-dev] [p4-factory]Error While running simple router - number of arguments are not correct

Mahesh Dananjaya dananjayamahesh at gmail.com
Fri Sep 2 01:40:50 EDT 2016


Hi guys,
we got small error while running /p4factory/targets/simple_route. following
the same steps as p4factory README file, we used

./run_add_demo_entries.bash.

Then the following error appeared.



File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)

Traceback (most recent call last):

 File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)

Traceback (most recent call last):

 File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)

Traceback (most recent call last):

 File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)

Traceback (most recent call last):

 File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)

Traceback (most recent call last):

 File "../../cli/pd_cli.py", line 677, in <module>

    main(sys.argv[1:])

 File "../../cli/pd_cli.py", line 665, in main

    pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)

 File "../../cli/pd_cli.py", line 35, in __init__

    self._thrift_client = pd_thrift_client.ThriftClient(self._module,
thrift_server, port, self._p4_name)

 File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in __init__

    self._session_handle = self._conn_mgr.client_init(16)

TypeError: client_init() takes exactly 1 argument (2 given)


-------------------------------------------------------------------------------------------------

Then we fix that issue by changing the
/p4factory/cli/pd_thrift_client.py", line 56

from,
self._session_handle = self._conn_mgr.client_init(16)

to,
self._session_handle = self._conn_mgr.client_init()


Now the error is not there all out p4s are running perfectly. even bvm2
programs.My question is,


Is this the correct way to do this or did we miss something.?


regards,

Mahesh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160902/f659f0a4/attachment-0002.html>


More information about the P4-dev mailing list