diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-02-25 16:05:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-25 16:05:00 +0000 |
commit | 9468dbfadece59cd4dd481594c9c098d974dad1a (patch) | |
tree | b0994a4c5b955b0b8ed528d7d7657633c77a35b7 /src | |
parent | e9d9c096c0e046939ff53d68baa230064ea93242 (diff) | |
parent | 216e80b61881a13c502f44c5d32fd7603b6ffe60 (diff) | |
download | vyos-1x-9468dbfadece59cd4dd481594c9c098d974dad1a.tar.gz vyos-1x-9468dbfadece59cd4dd481594c9c098d974dad1a.zip |
Merge pull request #4365 from c-po/lldp-t7165
lldp: T7165: add support to enable only rx/tx on specific interfaces
Diffstat (limited to 'src')
-rw-r--r-- | src/migration-scripts/lldp/2-to-3 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/migration-scripts/lldp/2-to-3 b/src/migration-scripts/lldp/2-to-3 new file mode 100644 index 000000000..93090756c --- /dev/null +++ b/src/migration-scripts/lldp/2-to-3 @@ -0,0 +1,31 @@ +# Copyright 2025 VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7165: Migrate LLDP interface disable to 'mode disable' + +from vyos.configtree import ConfigTree + +base = ['service', 'lldp'] + +def migrate(config: ConfigTree) -> None: + interface_base = base + ['interface'] + if not config.exists(interface_base): + # Nothing to do + return + + for interface in config.list_nodes(interface_base): + if config.exists(interface_base + [interface, 'disable']): + config.delete(interface_base + [interface, 'disable']) + config.set(interface_base + [interface, 'mode'], value='disable') |