Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'TRexTimeoutError' is not defined (trex_client.py) #123

Closed
pamartn opened this issue Jul 13, 2018 · 1 comment
Closed

NameError: name 'TRexTimeoutError' is not defined (trex_client.py) #123

pamartn opened this issue Jul 13, 2018 · 1 comment

Comments

@pamartn
Copy link

pamartn commented Jul 13, 2018

Hi,

We encountered a bug while calling the STL api in custom Python scripts.
Bug appears in Python2 and Python3.

OS : Ubuntu 14.04 LTS (recommended)
Trex version : 2.43
Bug summary : When calling "wait_on_traffic" method on an STLClient instance, trying to raise TRexTimeoutError will result as an error as it is not defined.
It is defined in /automation/trex_control_plane/interactive/trex/common/trex_exceptions.py, but not in __all__.

To fix it, change "trex_exceptions.py:8" :
__all__ = ["TRexError", "TRexArgumentError", "TRexTypeError"]
To :
__all__ = ["TRexError", "TRexArgumentError", "TRexTypeError", "TRexTimeoutError"]

And maybe add the "TRexConsoleError" and "TRexConsoleNoAction" to this list.

Backtrace :
c.wait_on_traffic(ports = conf_port, timeout = 2*duration)
File "/home/trex/trex/v2.43/automation/trex_control_plane/interactive/trex/common/trex_api_annotators.py", line 51, in wrap2
ret = f(*args, **kwargs)
File "/home/trex/trex/v2.43/automation/trex_control_plane/interactive/trex/stl/trex_stl_client.py", line 602, in wait_on_traffic
TRexClient.wait_on_traffic(self, ports, timeout)
File "/home/trex/trex/v2.43/automation/trex_control_plane/interactive/trex/common/trex_api_annotators.py", line 51, in wrap2
ret = f(*args, **kwargs)
File "/home/trex/trex/v2.43/automation/trex_control_plane/interactive/trex/common/trex_client.py", line 1620, in wait_on_traffic
raise TRexTimeoutError(timeout)
NameError: name 'TRexTimeoutError' is not defined

hhaim added a commit that referenced this issue Oct 2, 2018
@hhaim
Copy link
Contributor

hhaim commented Oct 2, 2018

fixed:
2c6dbb4

@hhaim hhaim closed this as completed Oct 2, 2018
odmyko pushed a commit to napatech/trex-core that referenced this issue Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants