Skip to content

Commit

Permalink
fix: removed csv headers from read rows
Browse files Browse the repository at this point in the history
  • Loading branch information
payaljindal committed Jan 23, 2024
1 parent 1db14cc commit 83f4c98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/target-server-validator/apigee_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def call_validator_proxy_parallel(self, arg_tuple):
)
return report
else:
logger.error(f"Error while calling the validator proxy - {response.get('error','unknown error')}") # noqa
return {"error": f"Error while calling the validator proxy - {response.get('error','unknown error')} with payload {arg_tuple[3]}"} # noqa

def write_proxy_bundle(self, export_dir, file_name, data):
file_path = f"./{export_dir}/{file_name}.zip"
Expand Down
5 changes: 4 additions & 1 deletion tools/target-server-validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def main():

output_reports = run_parallel(source_apigee.call_validator_proxy_parallel, args) # noqa
for output in output_reports:
final_report.extend(output)
if isinstance(output, list):
final_report.extend(output)
else:
logger.error(output.get("error", "Unknown Error occured while calling proxy")) # noqa

# Write CSV Report
# TODO: support relative report path
Expand Down
2 changes: 2 additions & 0 deletions tools/target-server-validator/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def read_csv(file_name):
rows = csv.reader(file)
for each_row in rows:
read_rows.append(each_row)
if len(read_rows) != 0:
read_rows.pop(0)
except FileNotFoundError:
logger.warning(f"File {file_name} not found ! ")
return read_rows
Expand Down

0 comments on commit 83f4c98

Please sign in to comment.