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

Version 0.23.0: tcshow throw exception #117

Closed
stephenyin opened this issue Jul 9, 2019 · 2 comments
Closed

Version 0.23.0: tcshow throw exception #117

stephenyin opened this issue Jul 9, 2019 · 2 comments

Comments

@stephenyin
Copy link

stephenyin commented Jul 9, 2019

Add incoming bandwidth limitation with dedicated ip addr and dst port:
tcset enp2s0 --rate 200kbps --direction incoming --src-network 192.168.3.188 --port 5201
Add another outgoing bandwidth limitation for the same ip addr without port:
tcset enp2s0 --rate 1000000kbps --direction outgoing --dst-network 192.168.3.188
Run
tcshow enp2s0
Get exception blow:

Traceback (most recent call last):
  File "/usr/local/bin/tcshow", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/tcconfig/tcshow.py", line 188, in main
    tc_params = extract_tc_params(options)
  File "/usr/local/lib/python3.6/dist-packages/tcconfig/tcshow.py", line 171, in extract_tc_params
    tc_params.update(rule_parser.get_tc_parameter())
  File "/usr/local/lib/python3.6/dist-packages/tcconfig/parser/shaping_rule.py", line 77, in get_tc_parameter
    in_rule_maps, _ = self.__get_shaping_rule(self.ifb_device)
  File "/usr/local/lib/python3.6/dist-packages/tcconfig/parser/shaping_rule.py", line 210, in __get_shaping_rule
    filter_key, rule_with_keys = self.__get_filter_key(filter_param)
  File "/usr/local/lib/python3.6/dist-packages/tcconfig/parser/shaping_rule.py", line 165, in __get_filter_key
    key_items[Tc.Param.DST_PORT] = "{:d}".format(dst_port)
ValueError: Unknown format code 'd' for object of type 'str'
@stephenyin stephenyin changed the title Version 0.23.0: tcshow throw unexception Version 0.23.0: tcshow throw exception Jul 9, 2019
@stephenyin
Copy link
Author

Fixed on my fork:https://github.com/stephenyin/tcconfig

@thombashi
Copy link
Owner

Thank you for your report.
The issue fixed at the tcconfig 0.24.0.

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