Skip to content

Commit 1691e12

Browse files
authored
Merge pull request ceph#65373 from phlogistonjohn/jjm-cephadm-build-ensure-byte-comp
cephadm: fail the script if byte-compile step fails Reviewed-by: Adam King <[email protected]> Reviewed-by: Redouane Kachach <[email protected]>
2 parents e154856 + 0b3e4a2 commit 1691e12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cephadm/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,16 @@ def _ignore_cephadmlib(
301301
def _compile(dest, tempdir):
302302
"""Compile the zipapp."""
303303
log.info("Byte-compiling py to pyc")
304-
compileall.compile_dir(
304+
ok = compileall.compile_dir(
305305
tempdir,
306306
maxlevels=16,
307307
legacy=True,
308308
quiet=1,
309309
workers=0,
310310
)
311+
if not ok:
312+
log.error("compileall.compile_dir failed (see output for details)")
313+
raise ValueError("byte-compile failed")
311314
# TODO we could explicitly pass a python version here
312315
log.info("Constructing the zipapp file")
313316
try:

0 commit comments

Comments
 (0)