Skip to content

Commit ec231f8

Browse files
authored
Fix the list append will in all list issue (#2456)
Signed-off-by: asc5543 <[email protected]>
1 parent 96be583 commit ec231f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

harvester_e2e_tests/apis/test_support_bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ def test_logfile_exists(self, support_bundle_state):
124124
patterns = [r"^.*/logs/cattle-fleet-local-system/fleet-agent-.*/fleet-agent.log",
125125
r"^.*/logs/cattle-fleet-system/fleet-controller-.*/fleet-controller.log",
126126
r"^.*/logs/cattle-fleet-system/gitjob-.*/gitjob.log"]
127-
matches = [[]] * len(patterns)
127+
matches = [[] for _ in range(len(patterns))]
128128
for f in support_bundle_state.files:
129129
for i in range(len(patterns)):
130130
matches[i].extend([f] if re.match(patterns[i], f) else [])
131131

132-
assert [] not in matches, (
132+
assert all(matches), (
133133
f"Some file(s) not found, files: {matches}\npatterns: {patterns}"
134134
)
135135

0 commit comments

Comments
 (0)