From 709fbcf8043c9fc636d2404e61de0f76ef5bad9d Mon Sep 17 00:00:00 2001 From: Nilashish Chakraborty Date: Fri, 5 Jul 2019 18:03:08 +0530 Subject: [PATCH] Fix fetching existing AS (#58756) Signed-off-by: NilashishC --- .../network/eos/providers/cli/config/bgp/process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/network/eos/providers/cli/config/bgp/process.py b/lib/ansible/module_utils/network/eos/providers/cli/config/bgp/process.py index a5302b2c371..a2f40affaea 100644 --- a/lib/ansible/module_utils/network/eos/providers/cli/config/bgp/process.py +++ b/lib/ansible/module_utils/network/eos/providers/cli/config/bgp/process.py @@ -23,7 +23,8 @@ class Provider(CliProvider): existing_as = None if config: match = re.search(r'router bgp (\d+)', config, re.M) - existing_as = match.group(1) + if match: + existing_as = match.group(1) operation = self.params['operation']