From 814b4e59b41ff22e5e6e39fc3968c8f96ac3a3ef Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 5 Nov 2023 17:51:28 +1100 Subject: [PATCH] fix: enc outputs *id001 in class/environment - the slice notation [:] creates a shallow copy of the list - when dumping the data, it will not use the anchors and aliases because it treats the values in enc_role and classes as separate lists --- enc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enc.py b/enc.py index 2e11abe..97e9c0c 100755 --- a/enc.py +++ b/enc.py @@ -34,11 +34,11 @@ def main(): # Add 'enc_role' parameter with classes data if "classes" in data: - data["parameters"]["enc_role"] = data["classes"] + data["parameters"]["enc_role"] = data["classes"][:] # Copy the environment to the parameters, if it exists if data.get("environment"): - data["parameters"]["enc_env"] = data["environment"] + data["parameters"]["enc_env"] = data["environment"][:] # If the environment is 'testing', remove it if data.get("environment") == "testing":