diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-24 18:14:49 +0000 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-03-24 18:14:49 +0000 |
commit | 8a4dd6c2816bf2289ad4af37ba301b31efdf30a8 (patch) | |
tree | 5974407307b60984e2b1c71ecf949b1ca182c0f2 /python/vyos/ifconfig/bond.py | |
parent | 09f8e57535849aab83df6947fbe94a0e7228ed40 (diff) | |
download | vyos-1x-8a4dd6c2816bf2289ad4af37ba301b31efdf30a8.tar.gz vyos-1x-8a4dd6c2816bf2289ad4af37ba301b31efdf30a8.zip |
ifconfig: T2057: add class Register
Diffstat (limited to 'python/vyos/ifconfig/bond.py')
-rw-r--r-- | python/vyos/ifconfig/bond.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py index c9dac891f..af4082f8f 100644 --- a/python/vyos/ifconfig/bond.py +++ b/python/vyos/ifconfig/bond.py @@ -21,6 +21,7 @@ from vyos.ifconfig.vlan import VLANIf from vyos.validate import * +@Interface.register class BondIf(VLANIf): """ The Linux bonding driver provides a method for aggregating multiple network @@ -30,6 +31,19 @@ class BondIf(VLANIf): monitoring may be performed. """ + default = { + 'type': 'bond', + } + definition = { + **Interface.definition, + ** { + 'section': 'bonding', + 'prefixes': ['bond', ], + 'broadcast': True, + 'bridgeable': True, + }, + } + _sysfs_set = {**VLANIf._sysfs_set, **{ 'bond_hash_policy': { 'validate': lambda v: assert_list(v, ['layer2', 'layer2+3', 'layer3+4', 'encap2+3', 'encap3+4']), @@ -69,10 +83,6 @@ class BondIf(VLANIf): } }} - default = { - 'type': 'bond', - } - def remove(self): """ Remove interface from operating system. Removing the interface |