From edd8995a4c817fecbb75b493a88500f931791451 Mon Sep 17 00:00:00 2001 From: Anton Kukushkin Date: Thu, 23 Jan 2025 13:31:58 +0000 Subject: [PATCH] Update seedfarmer/mgmt/metadata_support.py Co-authored-by: Patrick Cloke --- seedfarmer/mgmt/metadata_support.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/seedfarmer/mgmt/metadata_support.py b/seedfarmer/mgmt/metadata_support.py index 8d3bdf4..45732b6 100644 --- a/seedfarmer/mgmt/metadata_support.py +++ b/seedfarmer/mgmt/metadata_support.py @@ -166,9 +166,8 @@ def convert_cdkexports( else: clean_jq_path = _clean_jq(jq_path) _logger.info("Pulling with jq path '%s' from %s file", clean_jq_path, json_file) - with open("tmp-metadata", "w") as outfile: - cat_process = subprocess.Popen(["cat", cdk_output_path], stdout=subprocess.PIPE, shell=False) - subprocess.run(["jq", clean_jq_path], stdin=cat_process.stdout, stdout=outfile, shell=False) + with open(cdk_output_path, "r") as infile, open("tmp-metadata", "w") as outfile: + subprocess.run(["jq", clean_jq_path], stdin=infile, stdout=outfile, shell=False) data = json.loads(open("tmp-metadata", "r").read()) existing_metadata = _read_metadata_file(mms)