From 253a557f100d01668b2c28535372da7e0d9512a4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 19 Dec 2019 12:38:03 -0600 Subject: [PATCH] qa/workunits: python -> python3 throughout Signed-off-by: Sage Weil --- qa/workunits/cephtool/test.sh | 4 ++-- qa/workunits/fs/misc/rstats.sh | 2 +- qa/workunits/fs/snaps/snaptest-snap-rename.sh | 4 ++-- qa/workunits/mon/caps.py | 2 +- qa/workunits/mon/ping.py | 2 +- qa/workunits/mon/test_mon_config_key.py | 2 +- qa/workunits/rados/test_large_omap_detection.py | 2 +- qa/workunits/rbd/notify_master.sh | 2 +- qa/workunits/rbd/notify_slave.sh | 2 +- qa/workunits/rbd/test_lock_fence.sh | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 0733139117baa..d30fb3badae11 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -798,7 +798,7 @@ function wait_mds_active() function get_mds_gids() { fs_name=$1 - ceph fs get $fs_name --format=json | python -c "import json; import sys; print ' '.join([m['gid'].__str__() for m in json.load(sys.stdin)['mdsmap']['info'].values()])" + ceph fs get $fs_name --format=json | python3 -c "import json; import sys; print(' '.join([m['gid'].__str__() for m in json.load(sys.stdin)['mdsmap']['info'].values()]))" } function fail_all_mds() @@ -819,7 +819,7 @@ function fail_all_mds() function remove_all_fs() { - existing_fs=$(ceph fs ls --format=json | python -c "import json; import sys; print ' '.join([fs['name'] for fs in json.load(sys.stdin)])") + existing_fs=$(ceph fs ls --format=json | python3 -c "import json; import sys; print(' '.join([fs['name'] for fs in json.load(sys.stdin)]))") for fs_name in $existing_fs ; do echo "Removing fs ${fs_name}..." fail_all_mds $fs_name diff --git a/qa/workunits/fs/misc/rstats.sh b/qa/workunits/fs/misc/rstats.sh index 4c32edb234fc2..e6b3eddf287e8 100755 --- a/qa/workunits/fs/misc/rstats.sh +++ b/qa/workunits/fs/misc/rstats.sh @@ -33,7 +33,7 @@ check_rctime() { # does not notify ceph-fuse about it. Use fsync(3) instead. fsync_path() { cmd="import os; fd=os.open(\"$1\", os.O_RDONLY); os.fsync(fd); os.close(fd)" - python -c "$cmd" + python3 -c "$cmd" } set -e diff --git a/qa/workunits/fs/snaps/snaptest-snap-rename.sh b/qa/workunits/fs/snaps/snaptest-snap-rename.sh index 414ba0e35ef48..9301a2963775e 100755 --- a/qa/workunits/fs/snaps/snaptest-snap-rename.sh +++ b/qa/workunits/fs/snaps/snaptest-snap-rename.sh @@ -22,9 +22,9 @@ expect_failure mv d1/d2/.snap/_foo_* d1/d2/.snap/_foo_1 # can't rename snapshot to different directroy expect_failure mv d1/d2/.snap/bar d1/.snap/ # can't overwrite existing snapshot -expect_failure python -c "import os; os.rename('d1/d3/.snap/foo', 'd1/d3/.snap/bar')" +expect_failure python3 -c "import os; os.rename('d1/d3/.snap/foo', 'd1/d3/.snap/bar')" # can't move snaphost out of snapdir -expect_failure python -c "import os; os.rename('d1/.snap/foo', 'd1/foo')" +expect_failure python3 -c "import os; os.rename('d1/.snap/foo', 'd1/foo')" rmdir d1/.snap/foo rmdir d1/d2/.snap/bar diff --git a/qa/workunits/mon/caps.py b/qa/workunits/mon/caps.py index 20bb9e912dca8..f20aa6264e54a 100644 --- a/qa/workunits/mon/caps.py +++ b/qa/workunits/mon/caps.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 from __future__ import print_function diff --git a/qa/workunits/mon/ping.py b/qa/workunits/mon/ping.py index 1773c7369317d..a745976824d8a 100755 --- a/qa/workunits/mon/ping.py +++ b/qa/workunits/mon/ping.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import json import shlex diff --git a/qa/workunits/mon/test_mon_config_key.py b/qa/workunits/mon/test_mon_config_key.py index c0cb8299d9554..285d1f4cea6ad 100755 --- a/qa/workunits/mon/test_mon_config_key.py +++ b/qa/workunits/mon/test_mon_config_key.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # test_mon_config_key - Test 'ceph config-key' interface # diff --git a/qa/workunits/rados/test_large_omap_detection.py b/qa/workunits/rados/test_large_omap_detection.py index 7b09dfd907187..84e08088a4a59 100755 --- a/qa/workunits/rados/test_large_omap_detection.py +++ b/qa/workunits/rados/test_large_omap_detection.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- mode:python -*- # vim: ts=4 sw=4 smarttab expandtab # diff --git a/qa/workunits/rbd/notify_master.sh b/qa/workunits/rbd/notify_master.sh index 6ebea31ec8055..99ccd74db2d07 100755 --- a/qa/workunits/rbd/notify_master.sh +++ b/qa/workunits/rbd/notify_master.sh @@ -1,5 +1,5 @@ #!/bin/sh -ex relpath=$(dirname $0)/../../../src/test/librbd -python $relpath/test_notify.py master +python3 $relpath/test_notify.py master exit 0 diff --git a/qa/workunits/rbd/notify_slave.sh b/qa/workunits/rbd/notify_slave.sh index ea66161aefa24..7f49a0c7d06db 100755 --- a/qa/workunits/rbd/notify_slave.sh +++ b/qa/workunits/rbd/notify_slave.sh @@ -1,5 +1,5 @@ #!/bin/sh -ex relpath=$(dirname $0)/../../../src/test/librbd -python $relpath/test_notify.py slave +python3 $relpath/test_notify.py slave exit 0 diff --git a/qa/workunits/rbd/test_lock_fence.sh b/qa/workunits/rbd/test_lock_fence.sh index e425e161d0028..fd8fa6347d224 100755 --- a/qa/workunits/rbd/test_lock_fence.sh +++ b/qa/workunits/rbd/test_lock_fence.sh @@ -10,7 +10,7 @@ RBDRW=$RELPATH/rbdrw.py rbd create $IMAGE --size 10 --image-format 2 --image-shared || exit 1 # rbdrw loops doing I/O to $IMAGE after locking with lockid $LOCKID -python $RBDRW $IMAGE $LOCKID & +python3 $RBDRW $IMAGE $LOCKID & iochild=$! # give client time to lock and start reading/writing -- 2.39.5