Skip to content

Commit

Permalink
Update sonic_config.py skip if runnasn not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
juztas authored Feb 12, 2024
1 parent 0badc9d commit 7df02b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/modules/sonic_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,12 @@ def _genBGP(self, parser, newConf):
if not newConf:
return
senseasn = newConf.get("asn", None)
runnasn = parser.running_config.get("bgp", {}).get("asn", None)
if not senseasn:
return
if runnasn and int(senseasn) != int(runnasn):
runnasn = parser.running_config.get("bgp", {}).get("asn", None)
if not runnasn:
return
if int(senseasn) != int(runnasn):
msg = "Running ASN != SENSE ASN (%s != %s)" % (runnasn, senseasn)
raise Exception(msg)
# Append only if any new commands are added.
Expand Down

0 comments on commit 7df02b7

Please sign in to comment.