Learning paths › Automation › Exceptions and your first classes
Exceptions and your first classes
Ten lessons closing that series: a syntax error told from one raised at runtime, the specific exception caught rather than everything while cleanup still happens, a list of hosts pinged so one failure does not end the run — then a first pass at classes, defining one and creating an instance, initialising its state, sharing a default across every instance, and giving the object a useful printed form. Explanation and checks; two written exercises.
Lessons
- Tell a syntax error from a runtime one
- Handle a failure and still clean up
- Catch the specific exception, not everything
- Ping a list of hosts and survive failures
- Group state and behaviour into objects
- Watch objects interact by drawing
- Define a class and create an instance
- Initialise an instance's state
- Share a default across every instance
- Give your object a useful printed form
More in Automation
- First scripts that configure devices
- NAPALM: structured data across vendors
- Concurrency, and the Python types device output returns
- Parsing show output and testing conditions
- Readable code, branching and loops
- Build the workstation and the toolchain
- Files, CSV, JSON and pickle
- Paramiko: SSH to devices from Python
- Netmiko at fleet scale
- Tuples, sets and dictionaries for device records
- Plan and build the automation lab
- Files, formatting and regular expressions
- Addresses, functions, modules and classes
- CSV inventories, logging and scheduling
- Netmiko, SCP and structured parsing
- Agents, async and model-driven workflows
- NETCONF, YANG and RESTCONF
- NX-API, pyATS and Genie
- A small GenAI app, end to end
- macOS, Linux and the virtual lab
- Agile delivery and Python fundamentals
- REST APIs, authentication and requests
- Flask, Docker and Jenkins
- Managing a router with NETCONF and RESTCONF
- Ansible: inventory, ad-hoc commands and first playbooks
- Roles and zero-touch provisioning for Linux switches
- Installing the controller and applying a project
- Setting up Python 3
- The Ansible lab and the controller
- Vault, variables and config changes
- Parsing output and knowing which variable wins
- Jinja filters and PAN-OS automation
- Loops, callbacks, strategy and run control
- Roles, imports and writing your own module
- Running playbooks from AWX