Age | Commit message (Collapse) | Author |
|
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.
(cherry picked from commit 9c677c81be6a6e62958c73b038c2a36f1f629108)
|
|
Backport "dict_search_recursive" from vyos.util 1.4 to 1.3
data = {
'interfaces': {'dummy': {'dum0': {'address': ['192.0.2.17/29']}},
'ethernet': {'eth0': {'address': ['2001:db8::1/64', '192.0.2.1/29'],
'description': 'Test123',
'duplex': 'auto',
'hw_id': '00:00:00:00:00:01',
'speed': 'auto'},
'eth1': {'address': ['192.0.2.9/29'],
'description': 'Test456',
'duplex': 'auto',
'hw_id': '00:00:00:00:00:02',
'speed': 'auto'}}}
}
dict_search_recursive(data, 'hw_id') will yield both '00:00:00:00:00:01' and
'00:00:00:00:00:02' as generator object.
|
|
It is useful to have both a return code and output of the command
Add a new wrapper "rc_cmd" that returns both
% rc_cmd('uname')
(0, 'Linux')
% rc_cmd('ip link show dev fake')
(1, 'Device "fake" does not exist.')
(cherry picked from commit 14418b6d80ef4652a44d9280baf369c8e3c429fd)
|
|
Add op-mode CLI "show vpn ipsec connections"
Add the ability to show all configured connections/tunnels and
their states.
|
|
In the OpenVPN site-to-site config we can use IPv6 peers
without IPv4 configurations but "verify()" checks also local and
remote IPv4 addresses that in this case will be empty lists
For example:
set interfaces openvpn vtun2 local-address 2001:db8::1
set interfaces openvpn vtun2 remote-address 2001:db8::2
Check in the commit (v4loAddr == v4remAddr) <= both empty lists
commit
DEBUG: [] == [] or ['2001:db8::2'] == []
So we should also check v4loAddr, v4remAddr, v6loAddr, v6remAddr
are not empty
|
|
T4324, T4338, T4339 WWAN interface bugfixes
|
|
(cherry picked from commit 15c94a8706622927850eba8c22fcff2df32978b4)
|
|
(cherry picked from commit df0fbfeedce0f163e9d10be21d58ad4dc797a28a)
|
|
(cherry picked from commit 364009e4317fb5c6732635726b511613aa2ed519)
|
|
(cherry picked from commit 52cb6185a4a51ffa92f10e0ded55a943bc21bc60)
|
|
(cherry picked from commit c3661c8d5d7e8f5c1d040cadf134e87f0d77e28e)
|
|
(cherry picked from commit b40315b3c5051888f499961e63410e14c5d1bad7)
|
|
|
|
|
|
interfaces
|
|
Required by the vyos.ifconfig library - backported from 1.4 (current)
|
|
implementations
(cherry picked from commit 9d0c37fbbc91acc9f2c0f2abaab360479e451f0f)
|
|
commit_in_progress()
(cherry picked from commit a74e67a778a6c698e44cbc6c5d184d03c9c12396)
|
|
|
|
|
|
|
|
Keep the vyos.util function clean and not pull in the rest of the world
when importing it.
|
|
When waiting for processes that don't take long,
we need add an inotify watcher _before_ starting that process.
The pre-hook arguments allows the user to pass a () -> () anonymous function
to be called before adding a watch.
|
|
|
|
|
|
Replace function get_interface_config to
function get_interface_config, as we have
in 1.4 branch.
It need after this cherry-picked commit edcdea8
|
|
Implementing a wrapper which will - based on the command - add a sudo prefix
to the execution string seemed to be a nice idea but unfortunately it did not
only not get momentum but also the codebase somethis added an implicit "sudo"
call a second time.
This resulted in a call: "sudo sudo systemctl"
The entire functionality was removed again and if an op-mode script requires
root priviledges it must be explicitly called with them - no black magic.
(cherry picked from commit b76931e6d3a4bd0cdb74ca447a746ab6855fcf55)
|
|
(cherry picked from commit e96932cbd99f508f9f5c24b207b5650aa8817e45)
|
|
There had been four implementations of "ip -d -j link show interface" scattered
accross the codebase. Those implementations have now been combined into a new
helper:
vyos.util.get_json_iface_options()
(cherry picked from commit f13cc56d665a91ff3fac47df260301afefb1a3a5)
|
|
(cherry picked from commit 55c5d662290aea9f2c3abe911bd9920f4f9d7d9a)
|
|
|
|
|
|
Renamed using snippet below:
----------------------------
for file in $(find . -name "*.py")
do
sed -i "s/vyos_dict_search/dict_search/" $file
done
|
|
|
|
|
|
The current wversion unfortunately will raise a KeyError:
>>> data = {}
>>> vyos_dict_search('foo', data)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/vyos/util.py", line 685, in vyos_dict_search
return dict[path]
KeyError: 'foo'
|
|
|
|
|
|
This is faster implementation then using jmespath.search('foo.bar', dict).
|
|
vyos.template: T2720: Rework vyos.template Python library
|
|
* set system lcd device <device>
* set system lcd model <modeml>
Both device and model have completion helpers for supported interfaces and LCD
displays.
|
|
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>
|
|
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.
|
|
Extended the chmod() and chown() functions in vyos.util to also operate
on open file descriptors in addition to paths. This allows code that
creates files to quickly change mode and owner even before anything
has actually been written to the file.
|
|
|
|
|
|
|
|
|
|
|
|
|