From 12d79d836dcd7b5e190f8fa6c54488a2d5188347 Mon Sep 17 00:00:00 2001
From: sever-sever <v.gletenko@vyos.io>
Date: Fri, 26 Feb 2021 22:06:01 +0000
Subject: bgp: T3320: Add checks for peer-group

---
 src/conf_mode/protocols_bgp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 1ce2d3e7c..890196b31 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -96,7 +96,7 @@ def verify(bgp):
                 # Check if the configure peer-group exists
                 if 'peer_group' in peer_config:
                     peer_group = peer_config['peer_group']
-                    if peer_group not in asn_config['peer_group']:
+                    if 'peer_group' not in asn_config or peer_group not in asn_config['peer_group']:
                         raise ConfigError(f'Specified peer-group "{peer_group}" for '\
                                           f'neighbor "{neighbor}" does not exist!')
 
-- 
cgit v1.2.3