Age | Commit message (Collapse) | Author |
|
This reverts commit c4d389488970c8510200cac96a67182e9333b891.
Revert while investigating failure in vyos-configtest.
|
|
|
|
|
|
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.
|
|
|
|
This is a minor modification of the implementation by Thomas Mangin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Since lists in python are assigned by reference, taking the return value
from these functions and modifying it will modify all other return values
of functions that called the function before and did not explicitly copy
it.
To be safe, always make a copy of lists before returning them.
|
|
|
|
when there are uncommitted changes.
|
|
Without closing the communication channel to the subprocess, Python will
complain e.g. when executing vyos-smoketest binary.
/usr/lib/python3/dist-packages/vyos/configsession.py:110: ResourceWarning:
unclosed file <_io.BufferedReader name=3>
self.__run_command([CLI_SHELL_API, 'setupSession'])
ResourceWarning: Enable tracemalloc to get the object allocation traceback
|
|
|
|
In addition to ignoring edit level for the session config (12a21a4b),
the running config should be parsed from the top level.
|
|
|
|
* 'current' of github.com:vyos/vyos-1x:
T1855, T1826: Restore support for reboot/poweroff in M minutes.
vyos.config: T1764: allow for list argument to exists, in value case
vyos.config: T1846: ignore edit level when obtaining working config
T1843: use include files for interface proxy-arp-pvlan option
T1843: use include files for interface proxy-arp configuration
T1843: use include files for interface arp-cache-timeout configuration
T1843: use include files for interface link-detect feature
T1843: use include files for interface MTU size
T1843: use include files for interface MAC address
T1843: use include files to disable interface (admin down)
T1843: use include files for interface description
T1843: use include files for DHCP/DHCPv6 options
T1843: recursively include IP address definitions in VIF/VIF-S definitions
T1843: add support for recursive includes
T1843: use include files for VIF/VIF-S interfaces
T1843: use include files for IPv4/IPv6 interface address configuration
T1843: run interface-definitions though GCC preprocessor
|
|
|
|
|
|
|
|
* 'current' of github.com:vyos/vyos-1x:
openvpn: bridge: T1556: remove obsolete bridge-group definition
ifconfig: T1849: fix DHCPv6 startup
Python/VyOS validate: T1849: handle is_ipv6()/is_ipv6() exceptions
ifconfig: T1793: remove dhcpv6 client debug output
ddclient: T1853: bugfix TypeError exception
syslog: T1845: syslog host no longer accepts a port
syslog: code formatting
syslog: T1845: syslog host no longer accepts a port
syslog: renaming files and conf script to fit new scheme
T1855, T1826: clean up the reboot/shutdown script.
wireguard: T1853: disable peer doesn't work
Revert "syslog: T1845: syslog host no longer accepts a port"
dmvpn: T1784: Add swanctl load call
syslog: T1845: syslog host no longer accepts a port
[vyos.config] T1847: correctly set_level for path given as empty string
|
|
|
|
* 'current' of github.com:vyos/vyos-1x:
shutdown: T1826: Modify cancel reboot msg
T1801: move escaping of backslashes into configtree
vxlan: T1636: remove unused import statements
geneve: T1799: remove unused import statements
|
|
|
|
* 'current' of github.com:vyos/vyos-1x:
dns: T1786: add proper processing of 'system disable-dhcp-nameservers'
openvpn: fix typo in op-mode command on display rx bytes
T1801: escape isolated backslashes before passing to ConfigTree()
wireless: T1627: fix interface names for list_interfaces.py
[service https] T1443: add setting of HTTPS listen port
|
|
|
|
* 'current' of github.com:vyos/vyos-1x:
[conf completion]: T1779: Add tunnels to completion
[XML templates] T1772: Changed old hacks to proper regex, according to the fix
Add a function for retrieving config dicts.
snmp: make script extension code more readable
snmp: use proper stat literals on chmod()
snmp: fix verify() indent on script extensions
snmp: fix verify() bail out early order
snmp: T1738: cleanup import statements
T1759: Fixing dependency bug from previous commit
T1773, T1774: add a show config operation with JSON and raw options.
T1759: Merging interface.py into ifconfig.py
Allow list arguments in the vyos.config show_config() function.
Replace the try and wait for segfault approach with explicit inSession check.
T1773: add a script for converting the config to JSON. It also exposes those functions in vyos.configtree
[XML templates] T1772: Add escaping of `\` symbol in `<regex>`
|
|
|
|
|
|
|
|
Python 3.7 considers r'\s*' an empty pattern match, instead of the
previous behaviour of matching whitespace characters.
|
|
|
|
calling showConfig, else, default to config.boot
|
|
instead of calling cli-shell-api.
|
|
|
|
functions under it.
This is required for programs running outside a CLI session, like the future API daemon.
|
|
Add vyos.config.show_config to show working configuration.
Add vyos.remote.get_config_remote() for obtaining remote config files.
|
|
|
|
|
|
|
|
|
|
|
|
like their Perl counterparts.
Most scripts used to do something like
my $foo = $config->returnValue("system foo");
if !defined($foo) {
$foo = $defaultFooValue;
}
In most cases values do not exist because they are optional and simply not set.
In a substantial minority of cases they don't exist but are mandatory, in this case
it's probably a good practice to check if it exists first.
In rare but frustrating cases returnValue returns undef because the path is wrong.
It was tempting but as it turns out impractical to force the user to handle every undefined
value as an error, but the cost of wrapping every return_value call in a try/except block
is too high.
Instead we should facilitate the most common case. For this, those functions now support
an optional named argument default=None so an optional value with a sensible default can be
handled like
$foo = config.return_value("system foo", default="bar")
|
|
to avoid having to decode it anywhere else.
|