You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser.add_argument("-a","--agree-anonymous-data-collect", type=str, default='yes',help="Opt in for anonymous one time data collection.(yes/no). Only collects region name, creation time and uuid portion of the stack id (for uniqueness).")
81
+
82
+
83
+
# process arguments
84
+
args=parser.parse_args()
85
+
86
+
#region and stack ids
87
+
stack_regions= {}
88
+
89
+
globalstackname
90
+
stackname=args.stack_name
91
+
92
+
http=urllib3.PoolManager()
93
+
94
+
tepmlatefname=args.template_body
95
+
ifnot (os.path.isfile(tepmlatefname)):
96
+
print("invalid filename passed for cloudformation template body. Please check the file name and path.")
97
+
exit(1)
98
+
99
+
#Open and Read the Cloudformation
100
+
globaltemplateBody
101
+
f=open(tepmlatefname, "r")
102
+
templateBody=f.read()
103
+
104
+
# Get the list of regions
105
+
regions=args.region.split(',')
106
+
107
+
108
+
# validate all passed region names for correctness
109
+
forregioninregions:
110
+
111
+
regionregex=re.compile(r"^us-[a-z]*-[0-9]{1}")
112
+
regionmatch=re.search(regionregex, region)
113
+
114
+
ifnotregionmatch:
115
+
print ("Please provide a valid region name in region list. For example: us-east-1. Incorrect value", region)
0 commit comments