CertGrid CertGrid
Best Practices·Python Automation for IT

Python Automation Production Failure Patterns

Thirty-seven guides produced a lot of failures, and most of them were the same half dozen shapes: no timeout, no `check`, a shell where a list would do, a bare `except`, a credential in the wrong place. This guide collects every one into a single file, runs a linter over it, and counts: **22 findings**. Then it fixes them and counts again - and the four mistakes that survive a clean lint report are the point of the page.

Readiness Guide 39 of 39 Advanced

Written against the versions above. ruff 0.16.4 with `E, F, W, B, S, BLE, PLW, UP, SIM` selected. The `S` rules are flake8-bandit; `S603` fires on every `subprocess` call and does not distinguish a list from a shell string, which is why it needs a deliberate `noqa`.

Everything on this page runs on the control node. Any machine with Python 3 will do.
Server NameIP AddressOSRolesCPURAMHDD
RUNNER01192.168.0.27Ubuntu 26.04 LTSControl node - every script in this path runs here2 Core4 GB50 GB

Before you start

  1. A script with every mistake on this path in it

  2. What a linter catches for nothing

  3. The ones it explains best

  4. And the four it cannot see

  5. The same script, fixed - and what is left

  6. Four of those six are real

  7. The count, three ways

Official sources