Age | Commit message (Collapse) | Author |
|
Use the data in the default dict of the interface to generate
the output of list interface.
|
|
update all code using the API. Interface.interfaces() could be
used but the code was change to use Section.interfaces() which
make more sense when reading it.
|
|
While the class does indeed all the registration, it work is
really to map classes to interface section.
ie: interface ethernet -> EthernetIf
Therefore it can also list which interface are from which
type, therefore the name change. Other function name will
also be renamed as a consequence
|
|
dhcp: T2265: refactor DHCP class
|
|
|
|
Currently the pattern is to import jinja2 and re-generate
the template in every file. Dimitriy reported a reduction
in performance (1s) when commiting.
This code provide an helper function which caches the
Environment and template renderer, and can generate
template from one line (instead of the few currently)
|
|
Break the code between v4 and v6, remove need for getter/setter
as they are just exposing the underlying dict.
Move FixedDict from tunnel code and expose it to other part so
it can be used to prevent accidental change to the dhcp option if
no default exists already.
|
|
|
|
This reverts commit 10717c6a3cdf7da7025b03c1abdbd813b4970b19.
|
|
This is a base requirement for l2vpn evpn. When source-address is configured,
the option "local <source-addr> nolearning" is appended when creating the
interface as mentioned here: https://vincent.bernat.ch/en/blog/2017-vxlan-bgp-evpn
|
|
* 'vxlan' of github.com:c-po/vyos-1x:
vxlan: pseudo-ethernet: T2260: convert link nodes to source-interface
wireguard: T2206: fix comment in migration script
pppoe: enable Jinja2 trim_blocks
|
|
|
|
os.system does print the ouput of the command, run() does not.
A new function called call() does the printing and return the error code.
|
|
|
|
import: T2242: remove all import *
|
|
tunnel: T2028: fix remote and registration
|
|
airbag: T2186: report friendly user message and log to syslog
|
|
All interface classes register themselves so that we can figure
out from an interface name what class is responsible for its
creation. In the case of Tunnel, it is not the case as multiple
different interfaces are sharing the same "tun" prefix.
Still many operations are the same and it should be done.
|
|
This reverts commit 7219d4013814a55c4eeaf36b7a36d5e8076d09f0.
|
|
|
|
... to make it clear also directories can be chown(-ed)
|
|
|
|
|
|
All messages sent to stderr are now logged to syslog.
Also should a raise statement not be handled by the program,
a friendlier message is sent to the user (with the trace to
syslog)
It provide a new debug option: /tmp/vyos.developer.debug
when the file exists and the code raise without being caught up
the program will automatically fall into pdb port-morterm mode
allowing to investigate the reason for the failure
|
|
The code attempted to access the information on the file system
During the package build this is not available, therefore the
code was modified to return empty object when no data is there
|
|
Interfaces enslaved to a bridge are not allowed to be deleted. If an interface
is deleted from the config but it is still enslaved to a bridge will cause a
configuration error on the subsequent boot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
improves open and cmd adds a new help function run.
the extra optional arguments provide all the features of
subprocess used by every module of VyOS.
popen matches closely subprocess.Popen
cmd matches closely subprocess.check_output
run matches closely subprocess.call and os.system
popen returns the string and errord code
cmd returns the string and raise on error
(the class can be defined the default is OSError)
run returns the return code of the command
the options are:
shell=None, the code auto-detect is a shell is required
decode=None, use .decode() otherwise the encoding will be used
env=None, universal_newlines=None: as per subprocess.Popen
input=None, timeout=None, stdout=PIPE, stderr=STDOUT,
as per Popen.communicate
|
|
Commit b5310b0 ("ifconfig: l2tpv3: T1823: fix configuration build syntax") did
not cover all parts of the l2tpv3 config. Some parts when e.g. adjusting
l2tpv3 addresses after the tunnel was created did fail with the same error.
This has been fixed.
|
|
Now both files and directories are supported.
|
|
ifconfig: T2190: option to prevent Interface creation
|
|
ifconfig: T2205: silence ethtool harmless failures
|
|
a new option was added to the Interface class "create".
By default the value is set to True, and when an instance of the
class is created and the underlying interface does not exists, the
class will create it.
If the option "create" is set to False, the interface will not be
created and instead the class will raise an error when it is
instantiated.
|
|
Not all interface are capable of all features. Since commands are
now checked for valid completion, ethtool command failure must
be ignored.
|
|
|
|
|
|
|
|
Fixes reference to unspecified variable
Traceback (most recent call last):
File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 245, in <module>
apply(c)
File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 211, inapply
l = L2TPv3If(l2tpv3['intf'], **conf)
File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 185, in __init__
self._create()
File "/usr/lib/python3/dist-packages/vyos/ifconfig/l2tpv3.py", line 48, in _create
cmd = 'ip l2tp add tunnel tunnel_id {} '.format(config['tunnel_id'])
NameError: name 'config' is not defined
|
|
Commit 8a4dd6c2816 ("ifconfig: T2057: add class Register") added the interface
options but not all have been migrated. The forgotten ones have been
added by this commit (session_id & peer_session_id).
|
|
Import statement has been forgotton on the ifconfig file split.
|
|
The IPv6 address can be expressed in different ways:
(for example all these are valid loopback ::1, 0::1, 0:0::0:001)
The IPv6 need to be normalised when tested, and the best way to
do this is to test it on-wire representation, the same can be done
for IPv4.
Also The interface name which returned by netifaces.ifaddresses can
have a % in the 'addr' field, for example '::1%eth0', which would
also break the test in is_intf_addr_assigned.
|
|
This reverts commit e2f80e57d9895d207edf0ad92c299dc7862087d6.
Due to failing smoketests this commit is reverted.
|
|
validate: T2182: IPv6 are not normalised when compared
|
|
ifconfig: T2057: Move code from interface.py to wireguard.py
|