summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2020-07-01config_dict: T2668: move keyword arg get_first_key into get_sub_dictJohn Estabrook
2020-07-01config_dict: T2667: clarify docstringJohn Estabrook
2020-07-01config: T2667: add missing checkJohn Estabrook
2020-07-01Merge pull request #486 from jestabro/sub_dictChristian Poessinger
2020-07-01config: T2667: use get_sub_dict for get_config_dict(path, ...)John Estabrook
2020-07-01config: T2667: add utility function get_sub_dictJohn Estabrook
2020-07-01ifconfig: T2653: use better names for vyos.configverify functionsChristian Poessinger
2020-07-01ifconfig: T2653: move pppoe interface to get_config_dict()Christian Poessinger
2020-07-01Merge pull request #483 from runborg/frr-modChristian Poessinger
T2638: FRR: New framework for configuring FRR
2020-06-28T2638: FRR: New framework for configuring FRRRunar Borge
This commit adds the python module vyos.frr that support reading and modifying the frr cofiguration. Functions get_configuration() : Collects the configuration from FRR and returns it as a string reload_configuration() : uses frr-reload.py to activate a new configuration. The configuration applied will overwrite the current configuration. mark_configuration() : Does syntax check/validation and add "end" tags to the configuration The marked configuration will be returned as a string A syntax fault will render an Exception execute() : Execute a command inside vtysh configure() : Executes a command in vtysh config mode replace_section() / _replace_section() : Adds the ability to replace a section of frr code remove_section() : Removes the specified configuration block from the config For now this supports replacing complete config sub-blocks of configuration and selecting the daemon to replace inside. This should work for most daemons, but static routing will still be an issue because this is not a separate sub-config mode
2020-06-27xml: T2660: do replace - with _ for defaults when not flatteningThomas Mangin
2020-06-27xml: T2656: do not flatten dict by defaultChristian Poessinger
2020-06-27Merge branch 'T2656' of https://github.com/thomas-mangin/vyos-1x into currentChristian Poessinger
* 'T2656' of https://github.com/thomas-mangin/vyos-1x: xml: T2656: option to not flatten the default dict
2020-06-27xml: T2656: option to not flatten the default dictThomas Mangin
2020-06-27ifconfig: T2653: move macsec interface to get_config_dict()Christian Poessinger
2020-06-27ifconfig: T2653: add vyos.configverify.verify_source_interface() helperChristian Poessinger
2020-06-26ifconfig: T2653: add common vyos.configverify helpersChristian Poessinger
While moving towards a general interface abstraction based on get_config_dict() and the use of vyos.ifconfig.Interfaces().update() it also makes sense, to split out common verification code to a common util file - instead of duplicating the code, which is infact one of the main forces drivind this transition. vyos.configverify will hold common functions called via verify() from our src/conf_mode scripts so we do not need to copy/paste general verifications methods.
2020-06-26ifconfig: T2653: move loopback interface to get_config_dict()Christian Poessinger
2020-06-26ifconfig: T2653: move dummy interface to get_config_dict()Christian Poessinger
This changes the dummy interface implementation to make use of get_config_dict() and also implement a new vyos.ifconfig.Interface().update() function to gather all the scattered calls to update common interface configuration options. Derived classes of Interface() should extend update() to their needs for their special interface type - e.g. bond or bridge.
2020-06-26configdict: T2653: prevent recursive importsChristian Poessinger
2020-06-25xml: T2528: fix defaultsThomas Mangin
2020-06-25xml: T2528: fix to work with named tags (edit mode)Thomas Mangin
2020-06-25T2487: add an exception for the case when VRRP stats aren't available.Daniil Baturin
2020-06-24wireguard: T2632: add quotes when passing allowed-ipsChristian Poessinger
Commit 289f513 ("wireguard: T2632: support PSK on multiple peers") introduced a regression when multiple allowed-ips have been configured. They were not properly quoted when passing them down to the wg binary.
2020-06-24Merge pull request #474 from thomas-mangin/T2637Christian Poessinger
dictconfig: T2637: identify sub-interfaces (vif) to delete
2020-06-24dictconfig: T2637: identify sub-interfaces (vif) to deleteThomas Mangin
2020-06-24ifconfig: vxlan: T2629: append() takes exactly one argumentChristian Poessinger
Commit 9390988709 ("vxlan: T2629: fix multiple configuration issues") called append() on a list and passed two arguments which is invalid. Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces-vxlan.py", line 300, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces-vxlan.py", line 245, in apply v = VXLANIf(vxlan['intf'], **conf) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 221, in __init__ self._create() File "/usr/lib/python3/dist-packages/vyos/ifconfig/vxlan.py", line 84, in _create cmdline.append('group', 'src_interface') TypeError: append() takes exactly one argument (2 given)
2020-06-23Merge pull request #473 from thomas-mangin/T2630Christian Poessinger
validation: T2630: bound to interface mtu if available
2020-06-23validation: T2630: bound to interface mtu if availableThomas Mangin
2020-06-23Merge pull request #468 from SIN3R6Y/currentChristian Poessinger
vxlan: T2629: fix multiple configuration issues
2020-06-23wireguard: T2632: support PSK on multiple peersChristian Poessinger
It was not possible to configure two WG peers with both utilized a pre-shared key. This has been corrected. WG psk can only be read from a file when starting the interface. The code for creating this temporary file has been moved into the ifconfig.WireGuardIf() class. Tested with: ============ set interfaces wireguard wg0 address '192.0.2.0/31' set interfaces wireguard wg0 peer one allowed-ips '0.0.0.0/0' set interfaces wireguard wg0 peer one preshared-key 'e+SIIUcrnrSDHhbTtpjwKhSlSdUALA5ZvoCjfQXcvmA=' set interfaces wireguard wg0 peer one pubkey '/qQGAQ2HfLSZBSCpdgps04r9wRlK7bSFraCH9+MScmw=' set interfaces wireguard wg0 peer two allowed-ips '0.0.0.0/0' set interfaces wireguard wg0 peer two pubkey '/qQGAQ2HfLSZBSCpdgfooor9wRlK7bSFraCH9+MScmw='
2020-06-23xml: T2588: fix mistake when determining if a node is multiThomas Mangin
2020-06-23xml: T2588: allow multiple values in defaultsThomas Mangin
2020-06-22xml: T2588: add gitignore for generated defaultsChristian Poessinger
2020-06-22Merge branch 'T2588' of https://github.com/thomas-mangin/vyos-1x into ↵Christian Poessinger
default-doct * 'T2588' of https://github.com/thomas-mangin/vyos-1x: xml: T2588: code to extract defaults values from xml
2020-06-22xml: T2588: code to extract defaults values from xmlThomas Mangin
2020-06-22vxlan: T2629: fix multiple configuration issuesSIN3R6Y
2020-06-22Merge pull request #452 from jjakob/T2486-dns-hostsd-fixesDaniil Baturin
T2486: DNS, vyos-hostsd fixes
2020-06-21Increase version of Python library to 1.3.0Christian Poessinger
2020-06-18T2614: add a key mangling option to vyos.config.get_config_dict()Daniil Baturin
2020-06-18vyos: configdict: add dict_merge functionChristian Poessinger
Merge two dictionaries. Only keys which are not present in destination will be copied from source, anything else will be kept untouched. Function will return a new dict which has the merged key/value pairs. Before: {'device': {'usb0b2.4p1.0': {'speed': '9600'}, 'usb0b2.4p1.1': {'data-bits': '8', 'parity': 'none', 'speed': '115200', 'stop-bits': '2'}}} After: {'device': {'usb0b2.4p1.0': {'data-bits': '8', 'parity': 'none', 'speed': '9600', 'stop-bits': '1'}, 'usb0b2.4p1.1': {'data-bits': '8', 'parity': 'none', 'speed': '115200', 'stop-bits': '2'}}}
2020-06-16config: T2568: add missing error checkingJohn Estabrook
2020-06-15ifconfig: T2599: fix regex for search, smaller numbersThomas Mangin
2020-06-15ifconfig: T2599: sort interface by natural orderThomas Mangin
2020-06-15vti: T2576: show interfaces missed VTIThomas Mangin
2020-06-11hostsd_client.py: T2583: update for hostsd rewriteJernej Jakob
2020-06-07op-mode: T2558: version: split out CPU infoChristian Poessinger
Instead of using "show version" as catch-all command for information rather add "show system cpu" op-mode command which is analogous to "show system memory" which deals with RAM.
2020-06-07op-mode: T2558: fix hypervisor bug, add CPU info to "show version"kroy-the-rabbit
2020-06-06dhcpv6-pd: T2551: fixup configuration pathChristian Poessinger
Commit 728b1feaf744 ("dhcpv6-pd: T2551: fix prefix length not set in config") reworked the way the configuration path is accesses on the individual interfaces, but it was missed out to apply it correctly when reading in sla-len and sla-id values.
2020-06-06dhcpv6-pd: T2551: fix prefix length not set in configChristian Poessinger
Retrieving the CLI nodes from current config was missed out and only implemented for PPPoE.