Skip to content

Commit

Permalink
fix style issues
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak committed Nov 26, 2024
1 parent 6be74f7 commit cd0391b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,8 +2481,9 @@ def add_portchannel(ctx, portchannel_name, min_links, fallback, fast_rate):
db = ValidatedConfigDBConnector(ctx.obj['db'])
if ADHOC_VALIDATION:
if is_portchannel_name_valid(portchannel_name) != True:
ctx.fail("{} is invalid!, name should have prefix '{}' and suffix '{}' and its length should not exceed {} characters"
.format(portchannel_name, CFG_PORTCHANNEL_PREFIX, CFG_PORTCHANNEL_NO, IFACE_NAME_MAX_LEN))
ctx.fail("{} is invalid!, name should have prefix '{}' and suffix '{}' " \
"and its length should not exceed {} characters"
.format(portchannel_name, CFG_PORTCHANNEL_PREFIX, CFG_PORTCHANNEL_NO, IFACE_NAME_MAX_LEN))
if is_portchannel_present_in_db(db, portchannel_name):
ctx.fail("{} already exists!".format(portchannel_name)) # TODO: MISSING CONSTRAINT IN YANG MODEL

Expand Down
8 changes: 4 additions & 4 deletions config/vxlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def add_vxlan(db, vxlan_name, src_ip):
vxlan_count = len(vxlan_keys)

if(vxlan_count > 0):
ctx.fail("VTEP already configured.")
ctx.fail("VTEP already configured.")

fvs = {'src_ip': src_ip}
try:
Expand All @@ -62,7 +62,7 @@ def del_vxlan(db, vxlan_name):
vxlan_count = len(vxlan_keys)

if(vxlan_count > 0):
ctx.fail("Please delete the EVPN NVO configuration.")
ctx.fail("Please delete the EVPN NVO configuration.")

vxlan_keys = db.cfgdb.get_keys("VXLAN_TUNNEL_MAP|*")
if not vxlan_keys:
Expand All @@ -71,7 +71,7 @@ def del_vxlan(db, vxlan_name):
vxlan_count = len(vxlan_keys)

if(vxlan_count > 0):
ctx.fail("Please delete all VLAN VNI mappings.")
ctx.fail("Please delete all VLAN VNI mappings.")

vnet_table = db.cfgdb.get_table('VNET')
vnet_keys = vnet_table.keys()
Expand Down Expand Up @@ -103,7 +103,7 @@ def add_vxlan_evpn_nvo(db, nvo_name, vxlan_name):
vxlan_count = len(vxlan_keys)

if(vxlan_count > 0):
ctx.fail("EVPN NVO already configured")
ctx.fail("EVPN NVO already configured")

if len(db.cfgdb.get_entry('VXLAN_TUNNEL', vxlan_name)) == 0:
ctx.fail("VTEP {} not configured".format(vxlan_name))
Expand Down

0 comments on commit cd0391b

Please sign in to comment.