Skip to content

Commit

Permalink
Fixes for SNC-16498 (#44)
Browse files Browse the repository at this point in the history
* show running-config igmp and show running-config pim fixes

* Sub-Interface support added

* running-config pim
  • Loading branch information
g-balaji1 authored and GitHub Enterprise committed Feb 22, 2022
1 parent 89ba108 commit 8f1d236
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions CLI/actioner/sonic_cli_igmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,51 +384,42 @@ def show_igmp_running_config():
showrun_list = []
showrun_list.append((
"show_multi_views",
"views=configure-vlan,configure-if,configure-lag",
))
"views=configure-vlan,configure-if,configure-lag,configure-subif"))

rndr_cfg_all = showconfig_views_to_buffer(showrun_list)


igmp_intf_cfg_present = False
igmp_intf_start = False
igmp_intf_cfgs = ""
igmp_all_cfgs = ""

for cfg_line in rndr_cfg_all.replace("\n ", "\t ").splitlines():
for cfg_line in rndr_cfg_all.splitlines():

if re.search(r"^interface ", cfg_line):
if re.search("^interface ", cfg_line):
igmp_intf_cfgs += "\n" + cfg_line
igmp_intf_cfg_present = False
igmp_intf_start = True

if igmp_intf_start:
igmp_intf_cfgs += "\n" + cfg_line
#print("show_igmp_running_config - interface block {}".format(cfg_line))
if re.search(" ip igmp ", cfg_line):
if re.search("^ ip igmp", cfg_line):
igmp_intf_cfgs += "\n" + cfg_line
igmp_intf_cfg_present = True

if cfg_line == "!":
#print("show_igmp_running_config - cfg line block end")

if igmp_intf_start and igmp_intf_cfg_present:
#print("show_igmp_running_config - Added igmp Interface block {}".format(igmp_intf_cfgs))
igmp_all_cfgs += igmp_intf_cfgs + "\n"
igmp_all_cfgs += igmp_intf_cfgs + "\n" + "!"


igmp_intf_start = False
igmp_intf_cfg_present = False
igmp_intf_cfgs = ""

if igmp_intf_start and igmp_intf_cfg_present:
#print("show_igmp_running_config - Added last igmp interface block {}".format(igmp_intf_cfgs))
igmp_all_cfgs += igmp_intf_cfgs + "\n!\n"

#print("show_igmp_running_config - igmp_all_cfgs value{}".format(igmp_all_cfgs))

full_cmd = os.getenv("USER_COMMAND", None)
if full_cmd is not None:
pipestr().write(full_cmd.split())
write(igmp_all_cfgs.replace("\t", "\n"))
write(igmp_all_cfgs)



Expand Down

0 comments on commit 8f1d236

Please sign in to comment.