Executing a Clean

This page contains the information required to execute pyATS Clean and its available arguments. There are two different methods of using pyATS Clean – Integrated or Standalone.

Prerequisites

To use pyATS clean with either method, the following is required:

  • Testbed YAML file

  • Clean YAML file

Running before a pyATS Script

Running before a pyATS script is designed to make sure the device is in a good state, has the correct image, and the expected configuration.

Run with this command:

pyats run job </path/to/job.py> --testbed-file </path/to/testbed.yaml> --clean-file </path/to/clean.yaml> --invoke-clean

Running without a pyATS Script

Running without a pyATS script is designed to only clean the device; there isn’t a need to run a pyATS Script after.

Run with this command:

pyats clean --testbed-file </path/to/testbed.yaml> --clean-file </path/to/clean.yaml>

Passing images through CLI

Clean Schema Validation

Validating your clean datafile is very useful when writing a new clean as it gives immediate feedback.

Run with this command:

pyats validate clean --testbed-file /path/to/testbed.yaml --clean-file /path/to/clean.yaml