summaryrefslogtreecommitdiffstats
path: root/python/netlink/route
Commit message (Collapse)AuthorAgeFilesLines
* python: fix flake8 warnings E712Thomas Haller2023-07-251-1/+1
| | | | ./python/netlink/route/links/bridge.py:29:31: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
* python: fix flake8 warnings E741Thomas Haller2023-07-252-8/+8
| | | | | | | ./python/netlink/core.py:424:9: E741 ambiguous variable name 'l' ./python/netlink/route/link.py:476:13: E741 ambiguous variable name 'l' ./python/netlink/route/tc.py:554:5: E741 ambiguous variable name 'l' ./python/netlink/route/tc.py:574:5: E741 ambiguous variable name 'l'
* python: reformat all Python files with python-blackThomas Haller2023-07-258-311/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automated code formatting is great. Use python-black for that ([1]). Black us not configurable much (uncompromising) and follows PEP8. It thus generates quite a standard, pleasing format. But the point isn't whether the formatting is always the most subjectively pleasing. The point is that the style is generated and enforceable by an automated tool. It takes away places for nit picking, while resulting in a more consistent code base. As this reformats the entire code base, it introduces a large diff and interferes with tools like git-blame. That will be somewhat alleviated by adding a "blame.ignoreRevsFile" for git in the next commit. The change is done automatically, by running python-black version black-22.8.0-2.fc38.noarch: $ black . The result is the same as $ ( git grep -l '#!.*\(PYTHON\|python\)' ; git ls-files '*.py' '*.py.in' ) \ | sort -u \ | xargs -d '\n' black Note that the exact result depends on the version of black. Currently that version is black==22.12.0 from pip. Yes, this means when we bump the version in the future, some reformatting will happen. [1] https://github.com/psf/black
* Use print() function in both Python 2 and Python 3Christian Clauss2022-07-063-11/+9
| | | | https://github.com/thom311/libnl/pull/327
* build: merge python/Makefile.am into top-level makefileThomas Haller2017-02-271-14/+0
|
* python: add bridge flags APINicolas PLANEL2013-10-222-0/+45
| | | | | | | | | | | Add flags set/get methods aim to change bridge flags : o hairpin_mode o bpdu_guard o root_block o fast_leave Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* python: add basic netlink protocol bridge interface supportNicolas PLANEL2013-10-223-0/+118
| | | | | | | Implements basic bridge interface support using netlink protocol Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* python: fixup VLANLink() initializationNicolas PLANEL2013-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The varialble name should be link._rtnl_link instead of link._link to get rid of the AttributeError. Traceback (most recent call last): File "examples/test.py", line 11, in <module> eth0 = link.resolve('eth0.800') ... File "/home/ubuntu/libnl/python/build/lib.linux-x86_64-2.7/netlink/route/link.py", line 151, in __init__ self._module_lookup('netlink.route.links.' + self.type) ... File "/home/ubuntu/libnl/python/build/lib.linux-x86_64-2.7/netlink/route/links/vlan.py", line 70, in init link.vlan = VLANLink(link._link) AttributeError: 'Link' object has no attribute '_link' Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Add VXLAN support.Yasunobu Chiba2013-08-041-0/+63
|
* Add macvlan supportMichael Braun2013-05-161-0/+16
| | | | | | This patch add support for kernel macvlan interfaces. Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
* Enabled the use of Links as context managers.Antoni S. Puimedon2012-10-041-0/+9
| | | | | | | | | | | | | | | | | With this change you can still set do modifications of Links and then to change to pass the changes to the kernel. But it additionally enables you to interact with this part of libnl-python in a more pythonic way. Instead of: eth0 = links['eth0'] eth0.mtu = 5000 eth0.change() you can do: with links['eth0'] as eth0: eth0.mtu = 5000
* rtnl_link_(get|set)_weight is deprecated in libnl.Коренберг Марк (ноутбук дома)2012-06-082-21/+0
| | | | So, remove from python binding. Should not break compatibility.
* netlink.nlattr re-implemented in more pythonic wayКоренберг Марк2012-06-086-68/+53
|
* Remove unnecessary commentsКоренберг Марк (ноутбук дома)2012-06-085-169/+0
|
* Refine some placesКоренберг Марк (ноутбук дома)2012-06-081-18/+18
| | | | No real logick change
* pylint's first review and trivial fixesКоренберг Марк (ноутбук дома)2012-06-086-62/+75
|
* Using only single quotes now and multi-line listsКоренберг Марк (ноутбук дома)2012-06-085-23/+33
| | | | Nothing algorithmic changed really, just cosmetics
* Fix indentation (spaces vs tabs)Коренберг Марк (ноутбук дома)2012-06-087-1518/+1518
| | | | Now, python files use pseudo-tab equal 4 spaces
* Flags properties description and implementation fixedКоренберг Марк (ноутбук дома)2012-06-083-9/+42
| | | | | | | 1. Address, Link and Vlan classes affected with same bug 2. Flags property are not designed as set class. Setting to property will not replace flags, just add flags to set. So, jist document that, and fixed obvious logick.
* Fixed various str-related logickКоренберг Марк (ноутбук дома)2012-06-083-4/+4
|
* Fix whitespaces at EOLКоренберг Марк (ноутбук дома)2012-06-085-22/+22
| | | | Make git happy with that
* Introduce Python's absolute_importsКоренберг Марк (ноутбук дома)2012-06-087-28/+39
| | | | Helps greatly when porting to Python 3
* Make syntax highlighters happyКоренберг Марк (ноутбук дома)2012-06-081-1/+1
| | | | Fix typo in docstring
* Fixed address deletionКоренберг Марк (ноутбук дома)2012-06-081-3/+3
| | | | | 1. rtnl_addr_delete require three arguments 2. comment fixed (fixed copy-past from link.py)
* python: Include python/ in distribution and provide a README on how to build ↵Thomas Graf2011-08-121-0/+14
| | | | & install
* use rtnl_link_set/get_type()Thomas Graf2011-07-212-4/+4
|
* removed autogenerated swig interface files from git treeThomas Graf2011-07-212-10344/+0
|
* Work on libnl-pythonThomas Graf2011-06-1011-303/+10963
| | | | Changes too numerous to describe them
* python interface to netlink protocolsThomas Graf2011-05-1010-0/+2110
currently includes experimental support for links, addresses and some traffic control