Skip to content

Commit 51712aa

Browse files
authored
[build-failure-fix][GCU] Sort referrer paths alphabetically (#2015)
1 parent 4236bc4 commit 51712aa

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

generic_config_updater/gu_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ def _find_leafref_paths(self, path, config):
423423
ref_paths.append(ref_path)
424424
ref_paths_set.add(ref_path)
425425

426+
ref_paths.sort()
426427
return ref_paths
427428

428429
def _get_inner_leaf_xpaths(self, xpath, sy):

tests/generic_config_updater/gu_common_test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,13 @@ def test_find_ref_paths__path_is_table__returns_ref_paths(self):
639639
# Arrange
640640
path = "/PORT"
641641
expected = [
642-
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
643-
"/VLAN_MEMBER/Vlan1000|Ethernet0",
644642
"/ACL_TABLE/DATAACL/ports/0",
645-
"/ACL_TABLE/EVERFLOWV6/ports/0",
646-
"/VLAN_MEMBER/Vlan1000|Ethernet4",
647643
"/ACL_TABLE/EVERFLOW/ports/0",
644+
"/ACL_TABLE/EVERFLOWV6/ports/0",
648645
"/ACL_TABLE/EVERFLOWV6/ports/1",
646+
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
647+
"/VLAN_MEMBER/Vlan1000|Ethernet0",
648+
"/VLAN_MEMBER/Vlan1000|Ethernet4",
649649
"/VLAN_MEMBER/Vlan1000|Ethernet8"
650650
]
651651

@@ -659,14 +659,14 @@ def test_find_ref_paths__whole_config_path__returns_all_refs(self):
659659
# Arrange
660660
path = ""
661661
expected = [
662-
"/VLAN_MEMBER/Vlan1000|Ethernet0",
663-
"/VLAN_MEMBER/Vlan1000|Ethernet4",
664-
"/VLAN_MEMBER/Vlan1000|Ethernet8",
665-
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
666662
"/ACL_TABLE/DATAACL/ports/0",
667-
"/ACL_TABLE/EVERFLOWV6/ports/0",
668663
"/ACL_TABLE/EVERFLOW/ports/0",
664+
"/ACL_TABLE/EVERFLOWV6/ports/0",
669665
"/ACL_TABLE/EVERFLOWV6/ports/1",
666+
"/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
667+
"/VLAN_MEMBER/Vlan1000|Ethernet0",
668+
"/VLAN_MEMBER/Vlan1000|Ethernet4",
669+
"/VLAN_MEMBER/Vlan1000|Ethernet8",
670670
]
671671

672672
# Act

0 commit comments

Comments
 (0)