ceph / chacra

A binary/file REST API to aid in multi-distro|arch|release management
9 stars 18 forks source link

debian.py: Make sure subprocess is complete before checking returncode #303

Closed dmick closed 2 years ago

dmick commented 2 years ago

This was always wrong; there was always a race between the subprocess and the returncode check. Something about moving to Py3 has exposed this (perhaps the implementation had a mistaken wait, or perhaps the new implementation is just faster.)

Anyway, since we're already using communicate(), move it to before the returncode check, as it will wait for process completion.

Signed-off-by: Dan Mick dmick@redhat.com

dmick commented 2 years ago

Note: the thing that changed about Py3 is "comparison of None to int", which is now an error (but was silently accepted in Py2). So this was a latent bug in that returncode was probably often not yet available, so commands may well have failed but gone unnoticed.