@@ -139,24 +139,24 @@ def scan(
139139 flag_conditional_statements = False
140140 flag_resource_arn_statements = False
141141
142- output = Path (output )
143- input_file = Path (input_file )
144- if input_file .is_file ():
145- account_name = input_file .stem
146- account_authorization_details_cfg = json .loads (input_file .read_text (encoding = "utf-8" ))
142+ output_path = Path (output )
143+ input_file_path = Path (input_file )
144+ if input_file_path .is_file ():
145+ account_name = input_file_path .stem
146+ account_authorization_details_cfg = json .loads (input_file_path .read_text (encoding = "utf-8" ))
147147 rendered_html_report = scan_account_authorization_details (
148148 account_authorization_details_cfg ,
149149 exclusions ,
150150 account_name ,
151- output ,
151+ output_path ,
152152 write_data_files = True ,
153153 minimize = minimize ,
154154 flag_conditional_statements = flag_conditional_statements ,
155155 flag_resource_arn_statements = flag_resource_arn_statements ,
156156 flag_trust_policies = flag_trust_policies ,
157157 severity = severity ,
158158 )
159- html_output_file = output / f"iam-report-{ account_name } .html"
159+ html_output_file = output_path / f"iam-report-{ account_name } .html"
160160 logger .info ("Saving the report to %s" , html_output_file )
161161 if html_output_file .exists ():
162162 html_output_file .unlink ()
@@ -171,25 +171,25 @@ def scan(
171171 url = f"file://{ html_output_file .absolute ()} "
172172 webbrowser .open (url , new = 2 )
173173
174- if input_file .is_dir ():
174+ if input_file_path .is_dir ():
175175 logger .info ("The path given is a directory. Scanning for account authorization files and generating report." )
176- input_files = get_authorization_files_in_directory (input_file )
176+ input_files = get_authorization_files_in_directory (input_file_path )
177177 for file in input_files :
178178 logger .info (f"Scanning file: { file } " )
179179 account_authorization_details_cfg = json .loads (Path (file ).read_text (encoding = "utf-8" ))
180180
181- account_name = input_file .parent .stem
181+ account_name = input_file_path .parent .stem
182182 # Scan the Account Authorization Details config
183183 rendered_html_report = scan_account_authorization_details (
184184 account_authorization_details_cfg ,
185185 exclusions ,
186186 account_name ,
187- output ,
187+ output_path ,
188188 write_data_files = True ,
189189 minimize = minimize ,
190190 severity = severity ,
191191 )
192- html_output_file = output / f"iam-report-{ account_name } .html"
192+ html_output_file = output_path / f"iam-report-{ account_name } .html"
193193 logger .info ("Saving the report to %s" , html_output_file )
194194 if html_output_file .exists ():
195195 html_output_file .unlink ()
0 commit comments