summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2020-08-30config: T2636: get_config_dict() returns a list on multi node by defaultJohn Estabrook
Unless no_multi_convert is True, a single valued multi node will be returned as a list by get_config_dict(). Modification of Thomas Mangin's version.
2020-08-25T2826: frr: frr python lib error in replace_sectionRunar Borge
because of a bug in frr.py the default before_re will not be working. it is by default without a group, but will be used in a match that needs a group. The whole string could be matched in the group, so the fix is easy to implement.
2020-08-23T2755: convert jmespath.search() to vyos_dict_search() for performanceChristian Poessinger
2020-08-23vyos.configverify: T2677: extend verify_dhcpv6() for non duplicate sla-idsChristian Poessinger
2020-08-23vyos.util: T2755: add vyos_dict_search() to traverse a dictionaryChristian Poessinger
This is faster implementation then using jmespath.search('foo.bar', dict).
2020-08-23wireless: T2057: ensure interface state is properly setChristian Poessinger
2020-08-23ifconfig: vxlan: geneve: T2823: properly set interface stateChristian Poessinger
2020-08-23Revert "ifconfig: T2653: drop unused vyos.ifconfig.pppoe"Christian Poessinger
This reverts commit 5a5974d5a00b482cabd3dee92bc365d3c9f399bc. Required for operational mode "show interfaces" command.
2020-08-23dhcpv6-pd: T2821: support dhcpv6-pd without "address dhcpv6"Christian Poessinger
Currently DHCPv6-PD requires an interface address configured to dhcpv6 on the CLI. This is not required also sometimes there is either no dhcpv6 interface addressing available (PPPoE) or wanted. This limitation was artificial due to the old interface code. Change the implementation to spawn the DHCPv6 client and request a prefix even when there is no address request configured.
2020-08-22ifconfig: T2653: drop unused vyos.ifconfig.pppoeChristian Poessinger
2020-08-22dhcpv6-pd: T2677: optimize CLI interface for PD configurationChristian Poessinger
The current CLI did not support multiple prefix-delegations per interface. Some ISPs only send one /64 to a client per prefix-delegation request, but they allow the customer to request multiple prefixes. The 'dhcpv6-options prefix-delegation' node has been renamed and converted to a tag node named 'dhcpv6-options pd'. The tag node specifies a PD request (>=0). In the past the user needed to know what prefix will be assigned and required to calculate the sla-len by himself. The 'sla-len' node was dropped and is now calculated in the background from the 'dhcpv6-options pd 0 length' node. It is no longer mandatory to supply the 'sla-id' node, if sla-id is not specified it is 'guessed' by counting upwards. Example configuration: ---------------------- ethernet eth1 { address dhcpv6 dhcpv6-options { pd 0 { length 56 interface eth2 { address 1 } } } } This will request a /56 assignment from the ISP and will delegate a /64 network to interface eth2. VyOS will use the interface address ::1 on the delegate interface (eth2) as its local address.
2020-08-20VRRP: T2761: Extend "show vrrp" op-mode command with router priorityerkin
2020-08-19certbot: T2815: change config dir to /config/auth/letsencryptJohn Estabrook
2020-08-18ifconfig: T2653: bugfix when removing DHCP addressChristian Poessinger
DHCP service was not stopped when an DHCP address got removed from the interface. DHCP service is now always stopped if it is not configured explicitly.
2020-08-16Merge pull request #510 from efficiosoft/vyos_template_rewriteChristian Poessinger
vyos.template: T2720: Rework vyos.template Python library
2020-08-15Merge branch 't2564-lcd' of github.com:c-po/vyos-1x into currentChristian Poessinger
* 't2564-lcd' of github.com:c-po/vyos-1x: lcd: T2564: flatten CLI interface system display: T2564: Added test model system display: T2564: Dictionary code update system display: T2564: Conf files to /run system display: T2564: Changed "duration" to "time" system display: T2564: py code cleanup system display: T2564: Replace "config (enabled|disabled)" with "display disabled" system display: T2564: Lowercase model names system display: T2564 Extend VyOS to support appliance LCDs
2020-08-15vyos.configverify: no need to call .keys() when searching dictChristian Poessinger
2020-08-15vyos.configdict: keep is_member import as local as possibleChristian Poessinger
2020-08-15lcd: T2564: flatten CLI interfaceChristian Poessinger
* set system lcd device <device> * set system lcd model <modeml> Both device and model have completion helpers for supported interfaces and LCD displays.
2020-08-13ifconfig: dhcp: fix ModuleNotFoundError: No module named 'vyos.ifconfig.dhcp'Christian Poessinger
Commit 21bc98f1 ("ifconfig: dhcp: T2767: client must not start when interface is disabled") dropped the vyos.ifconfig.dhcp module but not removed it from the modules import list.
2020-08-12ifconfig: dhcp: T2767: client must not start when interface is disabledChristian Poessinger
ISC DHCP client will always place an Interface in admin-up state once it is started. We must ensure that if an interface is placed in A/D state that the DHCP client proccess is not launched and terminated if it is running.
2020-08-08http api: T1431: update args of call to install-imageJohn Estabrook
commit 3f8884587 added an endpoint for image management; T2753 updated the command line options. Make script call consistent.
2020-08-04dhcpv6-pd: T2741: support delegation on non existing interfacesChristian Poessinger
We must ignore any return code when invoking dhcpc6 initially. This is required to enable DHCPv6-PD for interfaces which are yet not up and running and my be started later by VyOS.
2020-08-03ifconfig: T2653: unify DHCPv4 configurationChristian Poessinger
Pass the interface dictionary transparently to the DHCP module and render the DHCP client config template directly from the same source instead of transcoding it once more.
2020-08-03ifconfig: T2740: pass config dict to DHCP class for IPv6Christian Poessinger
This removes additional code paths as we can instatly work with the input dict the same was as it was done for PPPoE. This fixes the entire DHCPv6-PD support on non PPPoE interfaces as this was lost in translation while processing T2653.
2020-08-01ifconfig: T2752: fix string format in verify_interface_exists()Christian Poessinger
We do not have a formatted string here thus the "f" keyword is wrong and triggered an exception.
2020-07-31ifconfig: T2653: bugfix on wrong flush_addr APIChristian Poessinger
Commit 29dd5079 ("ifconfig: T2653: remove duplicated code for address flush") used the class method for address flushing, but it was cvalled in the wrong way.
2020-07-30ifconfig: T2746: bugfix for non programmed link-local addressesChristian Poessinger
After the fresh rewrite of the interfaces to a unified solution (T2653) IPv6 link-local addresses are no longer added. This will result in e.g. broken RAs.
2020-07-30ifconfig: T2653: remove duplicated code for address flushChristian Poessinger
2020-07-26wireguard: ifconfig: T2653: move to get_config_dict()Christian Poessinger
The current VyOS CLI parser code written in Python contains a ton of duplicates which I can also hold myself accountable for - or maybe mainly me - depends on the angle of judge.
2020-07-26vxlan: ifconfig: T2653: move to get_interface_dict()Christian Poessinger
The current VyOS CLI parser code written in Python contains a ton of duplicates which I can also hold myself accountable for - or maybe mainly me - depends on the angle of judge.
2020-07-25vyos.configverify: T2653: fix some formatting issuesChristian Poessinger
2020-07-25ifconfig: T2653: make ifname an optional argument to get_interface_dict()Christian Poessinger
Further reduce the boiler-plate code to determine interface tag node or not. It can be passed into get_interface_dict() if explicitly required - else it is taken from the environment.
2020-07-25vyos.configdict: T2653: remove obsolete code from configdict and ifconfig_vlanChristian Poessinger
After all interfaces have been moved to the targetted implementation of T2653 the old implementations of migrating a CLI session to a configuration dict can be dropped.
2020-07-25ifconfig: T2653: move get_ethertype() from configdict to interfaceChristian Poessinger
... as it is only used inside the interface class.
2020-07-25vlan: ifconfig: T2653: move get_removed_vlans() to vyos.configdiffChristian Poessinger
As we wrap up additional functions from this library it should be part of it.
2020-07-25bonding: ifconfig: T2653: move to get_config_dict()Christian Poessinger
The current VyOS CLI parser code written in Python contains a ton of duplicates which I can also hold myself accountable for - or maybe mainly me - depends on the angle of judge.
2020-07-25ifconfig: T2653: move vlan configuration code to base classChristian Poessinger
This is required as other interfaces (e.g. pseudo-ethernet or bond) will have VLANs, too.
2020-07-25vyos.configdict: T2653: use dict_merge() over update()Christian Poessinger
With dict.update() existing keys will get overwritten when blending in interface default values.
2020-07-25ifconfig: T2653: implement update() in derived classes for admin up/downChristian Poessinger
Every derived class must implement update() to set the interfaces admin up/down state. This is required to prevend extensive link flaps when e.g. reconfiguring bond interfaces.
2020-07-25vyos.configdict: T2653: add new reusable helper node_changed()Christian Poessinger
This can be used to see if a tagNode has been changed. It will return a list of changed nodes.
2020-07-25ifconfig: T2653: move bridge member check to base classChristian Poessinger
This test is reused by a lot of instances and thus must be moved to the base class.
2020-07-25bridge: ifconfig: T2653: move to get_config_dict()Christian Poessinger
The current VyOS CLI parser code written in Python contains a ton of duplicates which I can also hold myself accountable for - or maybe mainly me - depends on the angle of judge. While providing a new update() method in vyos.ifconfig.interfaces() this is extended for bridge interfaces in the derived bridge class. Signed-off-by: Christian Poessinger <christian@poessinger.com>
2020-07-25vlan: ifconfig: T2653: only enable interface when lower interface is upChristian Poessinger
A VLAN interface can only be placed in admin up state when the lower interface is up, too. If this is not the case the operating system will throw and exception.
2020-07-25ethernet: ifconfig: T2653: move to get_config_dict()Christian Poessinger
The current VyOS CLI parser code written in Python contains a ton of duplicates which I can also hold myself accountable for - or maybe mainly me - depends on the angle of judge. While providing a new update() method in vyos.ifconfig.interfaces() this is extended for ethernet based interfaces which also supports 802.1q, 802.1ad VLANs. This commit migrates the existing codebase for an ethernet based interfaces and implements the missing parts for VLANs. Adding or migrating other interfaces (e.g. bridge or bond) will become much easier as they must reuse the entire functionality - we now walk towards a single codepath. Thanks for all who made this combined effort possible! Signed-off-by: Christian Poessinger <christian@poessinger.com>
2020-07-25vyos.util: add common helper to load kernel modulesChristian Poessinger
l2tpv3, wireguard, wirelessmodem, nat all require additional Kernel modules to be present on the system. Each and every interface implemented their own way of loading a module - by copying code. Use a generic function, vyos.util.check_kmod() to load any arbitrary kernel module passed as string or list.
2020-07-22xml: T2582: use xml for is_tag and is_leafThomas Mangin
2020-07-22config: T2707: use ConfigSource and refactor Config methodsJohn Estabrook
2020-07-22config: T2707: add ConfigSource classes for alternative init dataJohn Estabrook
2020-07-21 vyos.template: T2720: Rework vyos.template Python libraryRobert Schindler
Apart from code cleanup, this allows any module that wants to render a template to register custom jinja2 template filters by using the new @register_filter decorator. Examples can be found in vyos.template itself. Using the new render_to_string function, the rendered template can also be returned as a string instead of being written to a file.