diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-10-06 10:48:48 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-10-06 10:48:48 -0500 |
| commit | d238a582e47e89c12b34b010a6a02a07f5099819 (patch) | |
| tree | a0757ba84d919943e7966cc8020a543023e2da74 /src | |
| parent | 58f0829ad41f6c9f6ff4ae442f8cf45fb1299ea2 (diff) | |
| download | vyos-1x-d238a582e47e89c12b34b010a6a02a07f5099819.tar.gz vyos-1x-d238a582e47e89c12b34b010a6a02a07f5099819.zip | |
Revert "bgp: T7760: remove per vrf instance system-as node"
This reverts commit 85fe32f0e1a91a47fe4a6d4a5cdd6ac516dcc3b9.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/protocols_bgp.py | 8 | ||||
| -rw-r--r-- | src/migration-scripts/bgp/7-to-8 | 30 |
2 files changed, 8 insertions, 30 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index 4e7f09d0e..ab0e7e44a 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -18,6 +18,7 @@ from sys import exit from sys import argv from vyos.base import Warning +from vyos.base import DeprecationWarning from vyos.config import Config from vyos.configverify import has_frr_protocol_in_dict from vyos.configverify import verify_prefix_list @@ -218,6 +219,13 @@ def verify(config_dict): if not system_as: raise ConfigError(ERR_MSG_GLOBAL_VRF_AS_MISSING) + if 'system_as' in bgp: + tmp_as = bgp['system_as'] + DeprecationWarning(f'CLI command "vrf name {vrf} protocols bgp system-as ' \ + f'{tmp_as}" is ignored and will be removed in VyOS 1.5! ' \ + f'\n\nGlobal "protocols bgp system-as {system_as}" option ' \ + 'applies, use per neighbor "local-as" option to override.') + elif 'system_as' not in bgp: raise ConfigError(ERR_MSG_GLOBAL_VRF_AS_MISSING) diff --git a/src/migration-scripts/bgp/7-to-8 b/src/migration-scripts/bgp/7-to-8 deleted file mode 100644 index ced4f837e..000000000 --- a/src/migration-scripts/bgp/7-to-8 +++ /dev/null @@ -1,30 +0,0 @@ -#!/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']) |
