(DIO-834) Refactor to use pdb queries, output to GCS Bucket

This commit is contained in:
suckatrash 2020-08-25 05:36:41 -07:00
parent 854daa0d46
commit fd1ad61fce
No known key found for this signature in database
GPG key ID: 3857A763831B0756
9 changed files with 107 additions and 60 deletions

View file

@ -3,15 +3,12 @@
import sys
import subprocess
if len(sys.argv) == 1:
puppetdb = 'localhost'
elif len(sys.argv) == 2:
puppetdb = sys.argv[1]
else:
sys.exit("Expected 1 or 0 arguments. Got {}.".format(len(sys.argv) - 1))
puppetdb = sys.argv[1]
token = sys.argv[2]
bucket = sys.argv[3]
# Generate the report
subprocess.check_call(
["infinitory", "--host", "{}".format(puppetdb),
"--output", "/srv/infinitory/output"],
timeout=120)
["infinitory", "--host", puppetdb, "--token", token, "--bucket", bucket,
"--output", "/output/infinitory"],
timeout=300)