diff options
| author | Daniil Baturin <daniil@vyos.io> | 2025-09-23 16:01:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-23 16:01:35 +0100 |
| commit | bf1c29aa71980158a4e820d69351660e863cf219 (patch) | |
| tree | faec0ae12b342add260633086e6b3c51262a9504 /src/migration-scripts/bgp/7-to-8 | |
| parent | 9952d21aa35fd40fe583de1ac20287a6784e8052 (diff) | |
| parent | 85fe32f0e1a91a47fe4a6d4a5cdd6ac516dcc3b9 (diff) | |
| download | vyos-1x-bf1c29aa71980158a4e820d69351660e863cf219.tar.gz vyos-1x-bf1c29aa71980158a4e820d69351660e863cf219.zip | |
Merge pull request #4684 from c-po/bgp-vrf-system-as
bgp: T7760: remove per vrf instance system-as node
Diffstat (limited to 'src/migration-scripts/bgp/7-to-8')
| -rw-r--r-- | src/migration-scripts/bgp/7-to-8 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/migration-scripts/bgp/7-to-8 b/src/migration-scripts/bgp/7-to-8 new file mode 100644 index 000000000..ced4f837e --- /dev/null +++ b/src/migration-scripts/bgp/7-to-8 @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# T7760: Remove per VRF setting for system-as option in VyOS 1.5 and onwards + +from vyos.configtree import ConfigTree + +def migrate(config: ConfigTree) -> None: + vrf_base = ['vrf', 'name'] + if not config.exists(vrf_base): + return + + for vrf in config.list_nodes(vrf_base): + # bail out early if there is no per VRF BGP instance defined + vrf_bgp_base = vrf_base + [vrf, 'protocols', 'bgp'] + if config.exists(vrf_bgp_base + ['system-as']): + config.delete(vrf_bgp_base + ['system-as']) |
