Use errno symbol instead of hardcoded value in wait_for (#87087) (#87093)

(cherry picked from commit d772fe65b7)
This commit is contained in:
David Shrewsbury
2026-06-11 13:06:34 -05:00
committed by GitHub
parent 75d8321745
commit daeff35943
2 changed files with 3 additions and 1 deletions
@@ -0,0 +1,2 @@
bugfixes:
- wait_for - use ``errno.ENOENT`` symbolic constant instead of hardcoded value for improved code portability.
+1 -1
View File
@@ -581,7 +581,7 @@ def main():
os.stat(b_path)
except OSError as e:
# If anything except file not present, throw an error
if e.errno != 2:
if e.errno != errno.ENOENT:
elapsed = datetime.now(timezone.utc) - start
module.fail_json(msg=msg or "Failed to stat %s, %s" % (path, e.strerror), elapsed=elapsed.seconds)
# file doesn't exist yet, so continue