summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2023-06-10vyos.utils: T5248: add util function: dict of list[str]|str -> list of pathsJohn Estabrook
2023-06-06config-mgmt: T5262: move function 'unsaved_commits' to module scopeJohn Estabrook
The function 'unsaved_commits' was added in config_mgmt to warn a user of unsaved commits before commit-confirm, as that entails a possible reboot. As it has other uses and no dependence on the object itself, move to module scope. For general use, add simple check for live image to avoid false positive, due to config migration reformatting.
2023-05-31configtree: T5251: catch/raise error in delete and delete_valueJohn Estabrook
Configtree functions delete/delete_value do not check return value of libvyosconfig functions; raise error on non-zero return value.
2023-05-29ifconfig: T2104: use link_local_prefix literal for fe80::/64Christian Breunig
2023-05-28vyos.util: extend process_named_running() signature with cmdlineChristian Breunig
process_named_running() was introduced in commit 16b2fc8fc4ca ("dns-forwarding: T2298: fix path to control file") and thus remained more or less unchanged. Smoketests use process_named_running() heavily and might spawn multiple processes with the same name but ifferent options (e.g. dhcp6c or dhclient) and it was yet not possible to properly filter on the "real-deal" like the process bound to a given interface. One can now optionally specify a string that is searched inside the command line argument list of the process. Example: >>> process_named_running('dhcp6c', 'veth0') ['/usr/sbin/dhcp6c', '-D', '-k', '/run/dhcp6c/dhcp6c.veth0.sock', '-c', '/run/dhcp6c/dhcp6c.veth0.conf', '-p', '/run/dhcp6c/dhcp6c.veth0.pid', 'veth0'] 4215 >>> process_named_running('dhcp6c', 'veth1') ['/usr/sbin/dhcp6c', '-D', '-k', '/run/dhcp6c/dhcp6c.veth1.sock', '-c', '/run/dhcp6c/dhcp6c.veth1.conf', '-p', '/run/dhcp6c/dhcp6c.veth1.pid', 'veth1'] 4253 Where the debug list returned is the commandline searched.
2023-05-26xml: T5242: add cli_defined boolean test for node existing under pathJohn Estabrook
If non_local=False (default), cli_defined returns True if the node is a child of the path in interface-definitions; otherwise True if node is a descendent of the path.
2023-05-21Merge pull request #1997 from jestabro/reference-treeViacheslav Hletenko
xml: T5218: revise vyos xml lib for bug fixes and extensions
2023-05-19xml: T5218: return defaults only for child leaf-nodes, unless recursiveJohn Estabrook
Operations get_defaults and get_config_defaults return default values only for nodes with parent in the config dict (get_config_defaults) or at the path (get_defaults). To include default values of decendent nodes, set option recursive=True.
2023-05-17xml: T5218: add operations on xml cacheJohn Estabrook
2023-05-14Merge pull request #2007 from frebib/veth-netns-revertChristian Breunig
Revert "veth: T3829: Allow moving veth into netns"
2023-05-14Revert "veth: T3829: Allow moving veth into netns"Joe Groocock
netns management for any Vyos interfaces doesn't work past the initial creation, because Vyos always tries to recreate it/move it into the netns even though it already exists. Until this is fixed, don't let anyone even attempt to use this: set interfaces virtual-ethernet veth10 peer-name 'veth100' set interfaces virtual-ethernet veth100 netns 'ns01' set interfaces virtual-ethernet veth100 peer-name 'veth10' set netns name ns01 commit vyos@r14# sudo ip netns exec ns01 ip link show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 12: veth100@if13: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether ee:8f:0b:bd:a2:f8 brd ff:ff:ff:ff:ff:ff link-netnsid 0 [edit] vyos@r14# set interfaces virtual-ethernet veth100 description MyNetns commit Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces-virtual-ethernet.py", line 111, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces-virtual-ethernet.py", line 101, in apply p.update(veth) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1413, in update self.set_netns(config.get('netns', '')) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 552, in set_netns self.set_interface('netns', netns) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 183, in set_interface return self._set_command(self.config, name, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 110, in _set_command return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd)) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 52, in _cmd return cmd(command, self.debug) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd raise OSError(code, feedback) PermissionError: [Errno 1] failed to run command: ip link set dev veth100 netns ns01 returned: exit code: 1 noteworthy: cmd 'ip link set dev veth100 netns ns01' returned (out): returned (err): Cannot find device "veth100" This reverts commit f5cc8453860568351cd9b3b7a05d06e1462460e8.
2023-05-12ethernet: T3891: add conditional code-path when doing speed/duplex changesChristian Breunig
There is no need for the backend code to call ethtool and try to change speed or duplex settings every time there is a change in the interface configuration, but no change for the speed/duplex subnodes. This also makes the commit itself faster when working with ethernet interfaces. Bonus: no repeating CLI messages that the driver does not support speed/duplex changes, as we do not change anything here. Extension to commit f2ecc9710 ("ethernet: T3891: honor auto-negotiation support per NIC")
2023-05-12Revert "T4819: remove additional newline from vyos.base.Warning()"Christian Breunig
This reverts commit dd59e375bee722c220c58b047ff5c6e533cc7a00.
2023-05-11Merge pull request #1999 from dmbaturin/T5251-vrrp-group-ping-fixJohn Estabrook
vrrp: T5215: fix the commit error when health check is not configured
2023-05-11xml: T5218: generate xml cache from reference_treeJohn Estabrook
2023-05-11vyos.util: T5195: remove the unused camel case to snake case functionDaniil Baturin
that was replaced with Humps in all sciprts
2023-05-11vyos.utils: T5195: fix option list output in ↵Daniil Baturin
vyos.utils.dict.check_mutually_exclusive_options on missing options error
2023-05-10configtree: T5194: add function reference_tree_to_jsonJohn Estabrook
2023-05-10Merge pull request #1996 from frebib/veth-netnsChristian Breunig
veth: T3829: Allow moving veth into netns
2023-05-10veth: T3829: Allow moving veth into netnsJoe Groocock
This makes netns infinitely more useful as they can be chained together in many ways to build complex network structures all on the host. Signed-off-by: Joe Groocock <me@frebib.net>
2023-05-10Merge pull request #1989 from dmbaturin/T5195-file-utilsChristian Breunig
vyos.utils: T5195: add vyos.utils.file
2023-05-10Merge pull request #1990 from dmbaturin/T5195-conversion-utilsChristian Breunig
vyos.utils: T5195: add vyos.utils.convert
2023-05-10Merge pull request #1991 from dmbaturin/T5195-io-utilsChristian Breunig
vyos.utils: T5195: add vyos.utils.io
2023-05-10vyos.utils: T5195: add vyos.utils.fileDaniil Baturin
2023-05-10vyos.utils: T5195: add vyos.utils.ioDaniil Baturin
2023-05-10vyos.utils: T5195: add vyos.utils.convertDaniil Baturin
2023-05-10vyos.utils: T5195: add vyos.utils.dict.check_mutually_exclusive_optionsDaniil Baturin
2023-05-06ethernet: T3891: fix always true expression on auto-negotiationChristian Breunig
Commit f2ecc9710d49 ("ethernet: T3891: honor auto-negotiation support per NIC") added an if statement that always evaluated to True.
2023-05-04ethernet: T3891: honor auto-negotiation support per NICChristian Breunig
Not all drivers/NICs or combination of NIC + transceiver support auto- negotiation. The current auto-negotiation capability is evaluated and taken into account when applying spped/duplex settings. If auto-negotiation is not supported - we skip the setting to avoid errors during configuration.
2023-05-04T4819: remove additional newline from vyos.base.Warning()Christian Breunig
... just oo many new lines for multiple Warnings.
2023-05-04opmode: T5191: replace underscores with hyphens in generated optionsDaniil Baturin
2023-05-03T5195: add vyos.utils.dictDaniil Baturin
Old functions still remain in vyos.util for now
2023-04-26vrf: T5174: ensure no duplicate VNIs can be definedChristian Breunig
2023-04-25xml: T5179: fix missed case in multi_to_list conversionJohn Estabrook
2023-04-15vyos.ifconfig: T2104: support adding and removing VLANs in one call.Christian Breunig
VLANIf('eth0.10').remove() will create and remove the VLAN in one command. Thus one can ensure when calling remove() on a VLAN it will always succeed.
2023-03-30ipsec: T5093: Fixed 'reset vpn ipsec profile' commandaapostoliuk
Fixed 'reset vpn ipsec profile' command using vici library and new op-mode style. Added ability to use 'reset vpn ipsec profile' command with 'remote-host' option.
2023-03-29configdiff: T5089: add optional arg ordered_values for unit testsJohn Estabrook
2023-03-29configdiff: T5089: add union of configtrees for unit testJohn Estabrook
2023-03-28interfaces: T4885: fix Perl to Python rewrite of clear/reset_countersJohn Estabrook
2023-03-21Merge pull request #1903 from bstepler/T5104Christian Breunig
dhcp: pppoe: T5104: fix VRF comparisons
2023-03-21dhcp: pppoe: T5104: fix VRF comparisonsBrandon Stepler
2023-03-21Merge pull request #1902 from nicolas-fort/T5050-logChristian Breunig
T5050: fix smoketest policy_route, which was failing after previos co…
2023-03-21T5050: fix smoketest policy_route, which was failing after previos commit ↵Nicolas Fort
was merged
2023-03-21Merge pull request #1889 from nicolas-fort/T5050-logViacheslav Hletenko
T5050: Firewall: Add log options
2023-03-21T5050: Firewall: Add log optionsNicolas Fort
2023-03-14Merge pull request #1890 from nicolas-fort/T5055Viacheslav Hletenko
T5055: NAT: extend packet-type to NAT
2023-03-14T5055: NAT: extend packet-type match option which was previously introduced ↵Nicolas Fort
in firewall, to NAT
2023-03-13T2516: Exclude veth interfaces from duplex and speed checkViacheslav Hletenko
Exclude interfaces with 'veth' driver from duplex and speed check
2023-03-10Merge pull request #1871 from nicolas-fort/T5055Christian Breunig
T5055: Firewall: add packet-type matcher in firewall and route policy
2023-03-10T5058: Fix range_to_regex list argumentViacheslav Hletenko
Values of the list for the 'range_to_regex' could be not only range values as ['10-20', '22-30'] but also and not range values like ['10-20', '30', '80'] Fix if we args is list and non range values are exists in ths list % range_to_regex(['10-20', '80']) '(1\\d|20|80)'