From a046de852e76019b407c791acc4755c41ae5c7fe Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Thu, 7 May 2020 15:58:42 +0200 Subject: [PATCH] Make per_node.yaml py3 safe Use of python print() should work with both py2 and py3 but without it script execution fails on py3 Change-Id: Ifdf4426bf27ffa82f4c2096d2a1670b996b1f53c Closes-Bug: 1877378 --- puppet/extraconfig/pre_deploy/per_node.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/extraconfig/pre_deploy/per_node.yaml b/puppet/extraconfig/pre_deploy/per_node.yaml index 3cc046c822..64ba9acbb8 100644 --- a/puppet/extraconfig/pre_deploy/per_node.yaml +++ b/puppet/extraconfig/pre_deploy/per_node.yaml @@ -49,7 +49,7 @@ resources: import sys input = sys.stdin.readline() or '{}' cnt = json.loads(input) - print json.dumps(cnt.get('${node_id}', {})) + print(json.dumps(cnt.get('${node_id}', {}))) " > /etc/puppet/hieradata/${node_id}.json # handle upper case node id LP#1816652 echo $node_lookup | $(get_python) -c " @@ -57,7 +57,7 @@ resources: import sys input = sys.stdin.readline() or '{}' cnt = json.loads(input) - print json.dumps(cnt.get('${node_id_upper}', {})) + print(json.dumps(cnt.get('${node_id_upper}', {}))) " > /etc/puppet/hieradata/${node_id_upper}.json NodeSpecificDeployment: