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()
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
# 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
# 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
-#!/usr/bin/python
+#!/usr/bin/python3
from __future__ import print_function
-#!/usr/bin/python
+#!/usr/bin/python3
import json
import shlex
-#!/usr/bin/python
+#!/usr/bin/python3
#
# test_mon_config_key - Test 'ceph config-key' interface
#
-#!/usr/bin/python
+#!/usr/bin/python3
# -*- mode:python -*-
# vim: ts=4 sw=4 smarttab expandtab
#
#!/bin/sh -ex
relpath=$(dirname $0)/../../../src/test/librbd
-python $relpath/test_notify.py master
+python3 $relpath/test_notify.py master
exit 0
#!/bin/sh -ex
relpath=$(dirname $0)/../../../src/test/librbd
-python $relpath/test_notify.py slave
+python3 $relpath/test_notify.py slave
exit 0
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