Skip to content

Commit b01cbc3

Browse files
Merge branch 'master' into status_cli
2 parents 0844774 + dc59dbd commit b01cbc3

File tree

161 files changed

+9159
-2005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+9159
-2005
lines changed

acl_loader/main.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -670,17 +670,20 @@ def convert_rule_to_db_schema(self, table_name, rule):
670670
def deny_rule(self, table_name):
671671
"""
672672
Create default deny rule in Config DB format
673+
Only create default deny rule when table is [L3, L3V6]
673674
:param table_name: ACL table name to which rule belong
674675
:return: dict with Config DB schema
675676
"""
676677
rule_props = {}
677678
rule_data = {(table_name, "DEFAULT_RULE"): rule_props}
678679
rule_props["PRIORITY"] = str(self.min_priority)
679680
rule_props["PACKET_ACTION"] = "DROP"
680-
if self.is_table_ipv6(table_name):
681+
if self.is_table_l3v6(table_name):
681682
rule_props["IP_TYPE"] = "IPV6ANY" # ETHERTYPE is not supported for DATAACLV6
682-
else:
683+
elif self.is_table_l3(table_name):
683684
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
685+
else:
686+
return {} # Don't add default deny rule if table is not [L3, L3V6]
684687
return rule_data
685688

686689
def convert_rules(self):
@@ -707,7 +710,7 @@ def convert_rules(self):
707710
except AclLoaderException as ex:
708711
error("Error processing rule %s: %s. Skipped." % (acl_entry_name, ex))
709712

710-
if not self.is_table_mirror(table_name) and not self.is_table_egress(table_name):
713+
if not self.is_table_egress(table_name):
711714
deep_update(self.rules_info, self.deny_rule(table_name))
712715

713716
def full_update(self):

azure-pipelines.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ stages:
6969
source: specific
7070
project: build
7171
pipeline: 9
72-
artifact: sonic-swss-common.bullseye.amd64
72+
artifact: sonic-swss-common
7373
runVersion: 'latestFromBranch'
74-
runBranch: 'refs/heads/master'
74+
runBranch: 'refs/heads/$(sourceBranch)'
7575
displayName: "Download sonic swss common deb packages"
7676

7777
- script: |

clear/bgp_frr_v6.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def neigh_all(ipaddress):
2626
"""Clear all BGP peers"""
2727

2828
if ipaddress is not None:
29-
command = 'sudo vtysh -c "clear bgp ipv6 {}"'.format(ipaddress)
29+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {}".format(ipaddress)]
3030
else:
31-
command = 'sudo vtysh -c "clear bgp ipv6 *"'
31+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 *"]
3232
run_command(command)
3333

3434
# 'in' subcommand
@@ -38,9 +38,9 @@ def neigh_in(ipaddress):
3838
"""Send route-refresh"""
3939

4040
if ipaddress is not None:
41-
command = 'sudo vtysh -c "clear bgp ipv6 {} in"'.format(ipaddress)
41+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {} in".format(ipaddress)]
4242
else:
43-
command = 'sudo vtysh -c "clear bgp ipv6 * in"'
43+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 * in"]
4444
run_command(command)
4545

4646

@@ -51,9 +51,9 @@ def neigh_out(ipaddress):
5151
"""Resend all outbound updates"""
5252

5353
if ipaddress is not None:
54-
command = 'sudo vtysh -c "clear bgp ipv6 {} out"'.format(ipaddress)
54+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {} out".format(ipaddress)]
5555
else:
56-
command = 'sudo vtysh -c "clear bgp ipv6 * out"'
56+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 * out"]
5757
run_command(command)
5858

5959

@@ -69,22 +69,22 @@ def soft_in(ipaddress):
6969
"""Send route-refresh"""
7070

7171
if ipaddress is not None:
72-
command = 'sudo vtysh -c "clear bgp ipv6 {} soft in"'.format(ipaddress)
72+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {} soft in".format(ipaddress)]
7373
else:
74-
command = 'sudo vtysh -c "clear bgp ipv6 * soft in"'
74+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 * soft in"]
7575
run_command(command)
7676

7777

7878
# 'soft all' subcommand
79-
@neighbor.command('all')
79+
@soft.command('all')
8080
@click.argument('ipaddress', required=False)
8181
def soft_all(ipaddress):
8282
"""Clear BGP neighbors soft configuration"""
8383

8484
if ipaddress is not None:
85-
command = 'sudo vtysh -c "clear bgp ipv6 {} soft"'.format(ipaddress)
85+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {} soft".format(ipaddress)]
8686
else:
87-
command = 'sudo vtysh -c "clear bgp ipv6 * soft"'
87+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 * soft"]
8888
run_command(command)
8989

9090
# 'soft out' subcommand
@@ -94,8 +94,7 @@ def soft_out(ipaddress):
9494
"""Resend all outbound updates"""
9595

9696
if ipaddress is not None:
97-
command = 'sudo vtysh -c "clear bgp ipv6 {} soft out"' \
98-
.format(ipaddress)
97+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 {} soft out".format(ipaddress)]
9998
else:
100-
command = 'sudo vtysh -c "clear bgp ipv6 * soft out"'
99+
command = ['sudo', 'vtysh', '-c', "clear bgp ipv6 * soft out"]
101100
run_command(command)

clear/bgp_quagga_v4.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def neigh_all(ipaddress):
2727
"""Clear all BGP peers"""
2828

2929
if ipaddress is not None:
30-
command = 'sudo vtysh -c "clear ip bgp {}"'.format(ipaddress)
30+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {}".format(ipaddress)]
3131
else:
32-
command = 'sudo vtysh -c "clear ip bgp *"'
32+
command = ['sudo', 'vtysh', '-c', "clear ip bgp *"]
3333
run_command(command)
3434

3535

@@ -40,9 +40,9 @@ def neigh_in(ipaddress):
4040
"""Send route-refresh"""
4141

4242
if ipaddress is not None:
43-
command = 'sudo vtysh -c "clear ip bgp {} in"'.format(ipaddress)
43+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {} in".format(ipaddress)]
4444
else:
45-
command = 'sudo vtysh -c "clear ip bgp * in"'
45+
command = ['sudo', 'vtysh', '-c', "clear ip bgp * in"]
4646
run_command(command)
4747

4848

@@ -53,9 +53,9 @@ def neigh_out(ipaddress):
5353
"""Resend all outbound updates"""
5454

5555
if ipaddress is not None:
56-
command = 'sudo vtysh -c "clear ip bgp {} out"'.format(ipaddress)
56+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {} out".format(ipaddress)]
5757
else:
58-
command = 'sudo vtysh -c "clear ip bgp * out"'
58+
command = ['sudo', 'vtysh', '-c', "clear ip bgp * out"]
5959
run_command(command)
6060

6161

@@ -71,9 +71,9 @@ def soft_all(ipaddress):
7171
"""Clear BGP neighbors soft configuration"""
7272

7373
if ipaddress is not None:
74-
command = 'sudo vtysh -c "clear ip bgp {} soft"'.format(ipaddress)
74+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {} soft".format(ipaddress)]
7575
else:
76-
command = 'sudo vtysh -c "clear ip bgp * soft"'
76+
command = ['sudo', 'vtysh', '-c', "clear ip bgp * soft"]
7777
run_command(command)
7878

7979

@@ -84,9 +84,9 @@ def soft_in(ipaddress):
8484
"""Send route-refresh"""
8585

8686
if ipaddress is not None:
87-
command = 'sudo vtysh -c "clear ip bgp {} soft in"'.format(ipaddress)
87+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {} soft in".format(ipaddress)]
8888
else:
89-
command = 'sudo vtysh -c "clear ip bgp * soft in"'
89+
command = ['sudo', 'vtysh', '-c', "clear ip bgp * soft in"]
9090
run_command(command)
9191

9292

@@ -97,7 +97,7 @@ def soft_out(ipaddress):
9797
"""Resend all outbound updates"""
9898

9999
if ipaddress is not None:
100-
command = 'sudo vtysh -c "clear ip bgp {} soft out"'.format(ipaddress)
100+
command = ['sudo', 'vtysh', '-c', "clear ip bgp {} soft out".format(ipaddress)]
101101
else:
102-
command = 'sudo vtysh -c "clear ip bgp * soft out"'
102+
command = ['sudo', 'vtysh', '-c', "clear ip bgp * soft out"]
103103
run_command(command)

clear/bgp_quagga_v6.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def neigh_all(ipaddress):
2525
"""Clear all BGP peers"""
2626

2727
if ipaddress is not None:
28-
command = 'sudo vtysh -c "clear ipv6 bgp {}"'.format(ipaddress)
28+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp {}".format(ipaddress)]
2929
else:
30-
command = 'sudo vtysh -c "clear ipv6 bgp *"'
30+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp *"]
3131
run_command(command)
3232

3333

@@ -38,9 +38,9 @@ def neigh_in(ipaddress):
3838
"""Send route-refresh"""
3939

4040
if ipaddress is not None:
41-
command = 'sudo vtysh -c "clear ipv6 bgp {} in"'.format(ipaddress)
41+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp {} in".format(ipaddress)]
4242
else:
43-
command = 'sudo vtysh -c "clear ipv6 bgp * in"'
43+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp * in"]
4444
run_command(command)
4545

4646

@@ -51,9 +51,9 @@ def neigh_out(ipaddress):
5151
"""Resend all outbound updates"""
5252

5353
if ipaddress is not None:
54-
command = 'sudo vtysh -c "clear ipv6 bgp {} out"'.format(ipaddress)
54+
command = ['sudo', 'vtysh', '-c', 'clear ipv6 bgp {} out'.format(ipaddress)]
5555
else:
56-
command = 'sudo vtysh -c "clear ipv6 bgp * out"'
56+
command = ['sudo', 'vtysh', '-c', 'clear ipv6 bgp * out']
5757
run_command(command)
5858

5959

@@ -69,9 +69,9 @@ def soft_all(ipaddress):
6969
"""Clear BGP neighbors soft configuration"""
7070

7171
if ipaddress is not None:
72-
command = 'sudo vtysh -c "clear ipv6 bgp {} soft"'.format(ipaddress)
72+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp {} soft".format(ipaddress)]
7373
else:
74-
command = 'sudo vtysh -c "clear ipv6 bgp * soft"'
74+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp * soft"]
7575
run_command(command)
7676

7777

@@ -82,9 +82,9 @@ def soft_in(ipaddress):
8282
"""Send route-refresh"""
8383

8484
if ipaddress is not None:
85-
command = 'sudo vtysh -c "clear ipv6 bgp {} soft in"'.format(ipaddress)
85+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp {} soft in".format(ipaddress)]
8686
else:
87-
command = 'sudo vtysh -c "clear ipv6 bgp * soft in"'
87+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp * soft in"]
8888
run_command(command)
8989

9090

@@ -95,8 +95,7 @@ def soft_out(ipaddress):
9595
"""Resend all outbound updates"""
9696

9797
if ipaddress is not None:
98-
command = 'sudo vtysh -c "clear ipv6 bgp {} soft out"' \
99-
.format(ipaddress)
98+
command = ['sudo' ,'vtysh' ,'-c', "clear ipv6 bgp {} soft out".format(ipaddress)]
10099
else:
101-
command = 'sudo vtysh -c "clear ipv6 bgp * soft out"'
100+
command = ['sudo', 'vtysh', '-c', "clear ipv6 bgp * soft out"]
102101
run_command(command)

0 commit comments

Comments
 (0)