MCPcopy
hub / github.com/certbot/certbot / _dump_failed_build_logs

Function _dump_failed_build_logs

tools/snap/build_remote.py:197–221  ·  view source on GitHub ↗
(
        target: str, archs: Set[str], status: Dict[str, Dict[str, str]],
        workspace: str)

Source from the content-addressed store, hash-verified

195
196
197def _dump_failed_build_logs(
198 target: str, archs: Set[str], status: Dict[str, Dict[str, str]],
199 workspace: str) -> None:
200 logs_list = glob.glob(join(workspace, f'snapcraft-{target}-*.txt'))
201 for arch in archs:
202 result = status[target][arch]
203
204 if result != 'Succeeded':
205 failures = True
206
207 # log name is no longer set deterministically as target_arch.txt
208 # this will still result in a single output though, as we're filtering
209 # by target above and arch here
210 build_output_path = [log_name for log_name in logs_list if arch in log_name]
211 if not build_output_path:
212 build_output = 'No output has been dumped by snapcraft remote-build.'
213 else:
214 with open(build_output_path[0]) as file_h:
215 build_output = file_h.read()
216
217 print(f'Output for failed build target={target} arch={arch}')
218 print('-------------------------------------------')
219 print(build_output)
220 print('-------------------------------------------')
221 print()
222
223
224def _dump_results(archs: Set[str], status: Dict[str, Dict[str, str]]) -> None:

Callers 2

_build_snapFunction · 0.85
mainFunction · 0.85

Calls 2

joinFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected