Created
July 28, 2017 15:16
-
-
Save rmyers/bb7d74ff8d843394a36d2a3c7546b3a6 to your computer and use it in GitHub Desktop.
Generate a list of ddi's to add to a flag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Generate a list of flags for a set of customer DDI's from a csv file. | |
# | |
# Usage: | |
# python aws.py ddi_file.csv | |
import sys | |
import json | |
if len(sys.argv) < 2: | |
sys.exit('Please enter a csv file: python {0} csv_file.csv'.format(sys.argv[0])) | |
with open(sys.argv[1], mode='U') as ddi_list: | |
DDI_LIST = [line.strip() for line in ddi_list.readlines()] | |
flags = [] | |
for ddi in DDI_LIST: | |
flags.append({"args": "{0}".format(ddi), "name": "Tenant"}) | |
print json.dumps(flags) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment