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

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

This guide includes

Use this as the last pass over your own scripts. This matters because a linter catches most of these for nothing - and the four it cannot see are the ones that fail at three in the morning.

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