()
| 6 | |
| 7 | |
| 8 | def parse_args() -> argparse.Namespace: |
| 9 | parser = argparse.ArgumentParser( |
| 10 | description=""" |
| 11 | This script validates netplan example files against the cloud-init networkv2 |
| 12 | schema. The goal is to provide an easy way to track drift between networkv2 |
| 13 | and netplan. |
| 14 | |
| 15 | Netplan does not provide a centralized schema file to compare against directly, |
| 16 | but does maintain a reasonably comprehensive examples directory. This script |
| 17 | relies on that directory to glean the netplan schema. |
| 18 | """, |
| 19 | formatter_class=argparse.RawTextHelpFormatter, |
| 20 | ) |
| 21 | parser.add_argument( |
| 22 | "--schema-file", |
| 23 | required=True, |
| 24 | help=""" |
| 25 | The cloud-init networkv2 schema file found in |
| 26 | cloudinit/config/schemas/schema-network-config-v2.json |
| 27 | in this repository. |
| 28 | """, |
| 29 | ) |
| 30 | parser.add_argument( |
| 31 | "--netplan-examples", |
| 32 | required=True, |
| 33 | help=""" |
| 34 | The examples/ directory in the netplan repo. The most |
| 35 | recent netplan repo can be cloned from |
| 36 | https://github.com/canonical/netplan. |
| 37 | """, |
| 38 | ) |
| 39 | return parser.parse_args() |
| 40 | |
| 41 | |
| 42 | def validate_netplan_against_networkv2(schema_file, netplan_examples): |
no test coverage detected