X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fmodel%2Fraw2info.py;fp=resources%2Flibraries%2Fpython%2Fmodel%2Fraw2info.py;h=bd7d0e3cf1759821fe24468078a2b3517bbc0797;hp=7a3647d8575e2a782f7574adc6152726048b84cd;hb=5feb31a42f13c2e34df4b76a0b722b3fa7c439e0;hpb=cd1f9904e173ecb34836b33cb551ab9b9d378e18 diff --git a/resources/libraries/python/model/raw2info.py b/resources/libraries/python/model/raw2info.py index 7a3647d857..bd7d0e3cf1 100644 --- a/resources/libraries/python/model/raw2info.py +++ b/resources/libraries/python/model/raw2info.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -257,7 +257,7 @@ def _merge_into_suite_info_file(teardown_info_path): suite_data[u"teardown_log"] = teardown_data[u"log"] suite_info_path = u"suite".join(teardown_info_path.rsplit(u"teardown", 1)) - with open(suite_info_path, u"xt", encoding="utf-8") as file_out: + with open(suite_info_path, u"wt", encoding="utf-8") as file_out: json.dump(suite_data, file_out, indent=1) # We moved everything useful from temporary setup/teardown info files. os.remove(setup_info_path) @@ -285,7 +285,7 @@ def convert_content_to_info(from_raw_path): data = _convert_to_info_in_memory(data) - with open(to_info_path, u"xt", encoding="utf-8") as file_out: + with open(to_info_path, u"wt", encoding="utf-8") as file_out: json.dump(data, file_out, indent=1) if to_info_path.endswith(u"/teardown.info.json"): to_info_path = _merge_into_suite_info_file(to_info_path)