Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Previously all vlan configs, which are dicts, were appended to a simple
list, with the distinguishing 'id' stored inside the dicts themselves.
This worked, but wasn't ideal.
This commit converts them to dicts, where the key is the VLAN ID and
value the config dict of that VLAN. This makes it posible to access
single VLANs by their ID (key) and we can for-loop and get both the ID
and config with: 'for vif_id, vif in conf["vif"].items():'
|
|
Commit 3fdf0093a introduced code that removed all addresses from an
interface when that interface is disabled. This is wrong, as other
configured services may be listening on these addresses and may fail to
start if their configured address isn't present.
It also caused a commit error when applying dhcp-server configuration:
DHCP server configuration error!
None of configured DHCP subnets does not have appropriate
primary IP address on any broadcast interface.
This commit reverts it to prior behavior, which was to just put the
interface admin down and leave all addresses configured, other than the
IPv6 'fe80::EUI-64/64' link-local, which it deletes, as the interface
may not have a MAC if it's put down.
|
|
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.
|
|
Add a function that converts an interface name to its config path.
For example: 'eth0.1.2' -> 'ethernet eth0 vif-s 1 vif-c 2'
|
|
Previously the function returned the correct basename only for vif interfaces
as it stopped at the 2nd dot. If we had a vif-s vif-c interface 'eth0.1.2' it
would return 'eth0.'. It is now fixed to strip both vif-s and vif-c if
'vlan=True' (default).
|
|
|
|
Bridge members should not have addresses assigned.
|
|
Bridge members should not have addresses assigned.
|
|
Previously, set_vrf was always called, which uses the same master and nomaster
commands as bridge, so it removed the interface from the bridge.
- add checks to make VRF and bridge membership mutually exclusive
- always re-add the interface back to any bridge it is part of in
case it is deleted and recreated (e.g. changing egress/ingress-qos)
|
|
Will be called by all interface scripts to re-add themselves to a bridge
after deleting and recreating themselves.
|
|
Function that parses the config of a bridge member into a dict that is
needed to apply all port config when adding a port to a bridge.
Needed because other interfaces will be adding themselves to the bridge
outside of the bridge conf_mode script and they need a common place to
get their config.
Can't be put as method of BridgeIf as we can't invoke it without it
creating the bridge (create=False raises an exception), we need to
get the configuration before we create the interface.
|
|
|
|
|
|
- rewrite the function to support both bridge and bonding interface types,
if the type is passed it searches only that type, otherwise it searches
both
- move is_member check out of the deleted condition
- move is_member check to intf_from_dict for interfaces that use it
|
|
This is needed as later functions depend on it
|
|
|
|
Remove one unnecessary call to conf.get_level()
|
|
- detriplicate list appending
- detriplicate returns
- use if-elif-else
- move check if address is already added to beginning
- move caching in variable to after address assignment so a failed
assignment won't cache the address
|
|
|
|
|
|
T2367: flush addresses when adding bond/bridge members
|
|
Add function that flushes all addresses from an interface.
|
|
Correctly track addresses in cache _addr variable
|
|
off-by one line where the IP were added to the add list
and not the remove list
|
|
disable :T2372: disable sub-interface if parent is
|
|
implement disable_state which looks if the current node, or some
designated parent node are set are 'disable' and thefore should
be ignored.
break down the function vlan_to_dict in it multiple components
add_to_dict which can parse vif, vif-s, or vif-c and add them
to the configuration dictionary
intf_to_dict which setup a base configuration dictionary from the
interface Config() with addresses, arp, disable, ...
it is used by vlan_to_dict but can and will be used by other interfaces
|
|
tolls intact
|
|
The intermedite class only held the path to the configuration files - thus
its existence was doubtworthy. For better readability and a clean
inheritance graph that class has been dropped.
|
|
|
|
|
|
|
|
|
|
template: T2388: move mkdir/chmod/chown within render()
|
|
util: T2226: multiple improvements
|
|
|
|
|
|
debug.noteworthy can be used to record noteworhy event during
the lifetime of the program. Should anything then cause the
program to fail and cause an airbag report to the user,
then this information will also be included.
|
|
add an option to cmd() allowing to define a list of error codes
which are expected when runnin the command. the default is only
to expect zero (no error).
|
|
Do not agreggate stderr with stdout. So if a command reports
a message on stderr but does not report an error, it will
not be send to the user to confuse him.
Explicitely set encoding to utf-8, which does not change
the code behaviour but simplify the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|