mirror of
https://github.com/floci-io/floci.git
synced 2026-12-06 03:28:18 -05:00
Three constraint generators still repeated the driver request_shapes.main provides: their own argparse block, the strip_source comparison for --check and the write. They now hand it their model, output and operations, the two-line delegation regen_sts_shapes.py and the other constraint generators use. The vendored files regenerate byte for byte, _source included. Resource Groups and Logs delivery gain what the driver gives the rest: main() takes argv, so a test can drive it, --check names the stale file instead of exiting 1 silently, and a write says where it wrote. The three join the test that pins each constraint generator's call to the driver. The driver's module docstring no longer says the three call build_constraints() themselves, and says which generators take that path through main() rather than naming IAM and STS alone.
23 lines
725 B
Python
23 lines
725 B
Python
#!/usr/bin/env python3
|
|
"""Vendor Resource Groups request constraints from botocore's Apache-2.0 service model."""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import request_shapes
|
|
from request_shapes import REPO_ROOT
|
|
|
|
OUTPUT = REPO_ROOT / "src/main/resources/aws/resource-groups-request-shapes.json"
|
|
MODEL = Path("resource-groups/2017-11-27")
|
|
OPERATIONS = ("CreateGroup", "GetGroup", "DeleteGroup", "GroupResources", "ListGroupResources")
|
|
|
|
|
|
def main(argv: list[str] | None = None) -> int:
|
|
return request_shapes.main(argv, script=__file__, model=MODEL, output=OUTPUT,
|
|
description=__doc__, operations=OPERATIONS)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|