From 37b5d1084ab21b897d939d5801cf8857bc98d7a7 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Fri, 1 Feb 2019 08:32:14 -0500 Subject: [PATCH] Make python print statements python3 compatible The restart_osd_daemon.sh generated from the j2 template contains a python call which uses 'print x' instead of 'print(x)'. Add the missing parentheses to make this call compatible with both 2 and 3. Also add parentheses to other python print calls found in roles/ceph-client/defaults/main.yml and infrastructure-playbooks/cluster-os-migration.yml. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1671721 Signed-off-by: John Fulton --- group_vars/clients.yml.sample | 2 +- .../untested-by-ci/cluster-os-migration.yml | 2 +- roles/ceph-client/defaults/main.yml | 2 +- roles/ceph-handler/templates/restart_osd_daemon.sh.j2 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/group_vars/clients.yml.sample b/group_vars/clients.yml.sample index 34926b202..41732efd8 100644 --- a/group_vars/clients.yml.sample +++ b/group_vars/clients.yml.sample @@ -44,7 +44,7 @@ dummy: # Eg: # $ ceph-authtool --gen-print-key # or -# $ python2 -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack(' - test "[""$(ceph -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])')""]" = "$(ceph -s -f json | python -c 'import sys, json; print [ i["count"] for i in json.load(sys.stdin)["pgmap"]["pgs_by_state"] if i["state_name"] == "active+clean"]')" + test "[""$(ceph -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])')""]" = "$(ceph -s -f json | python -c 'import sys, json; print([ i["count"] for i in json.load(sys.stdin)["pgmap"]["pgs_by_state"] if i["state_name"] == "active+clean"])')" register: result until: result.rc == 0 retries: 10 diff --git a/roles/ceph-client/defaults/main.yml b/roles/ceph-client/defaults/main.yml index 35a5f6976..22a6de76b 100644 --- a/roles/ceph-client/defaults/main.yml +++ b/roles/ceph-client/defaults/main.yml @@ -36,7 +36,7 @@ pools: # Eg: # $ ceph-authtool --gen-print-key # or -# $ python2 -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack('