]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test: misc python -> python3
authorSage Weil <sage@redhat.com>
Thu, 19 Dec 2019 22:31:34 +0000 (16:31 -0600)
committerSage Weil <sage@redhat.com>
Fri, 20 Dec 2019 13:17:10 +0000 (07:17 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/admin_socket/objecter_requests
src/test/admin_socket/osd_requests
src/test/cli-integration/rbd/defaults.t
src/test/cli-integration/rbd/formatted-output.t
src/test/librbd/rbdrw.py
src/test/librbd/test_notify.py
src/test/rgw/test-rgw-common.sh

index c2655cdb74b7c08d92710ceeb5fe42c08d756bbf..c4c9edf9601a67416b80747da0be82dabf1b7f6e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import json
 import sys
index f748d9dc176797ab0688fbdd3afe2f312126437c..4da514e6f1792eba80af419f44acb5188e8f9049 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import json
 import sys
index 36a623e767c8a9fbf44c6d51a60928a2129f9676..fe69997ce480239ae72448a815de74b316ebea5b 100644 (file)
@@ -1,7 +1,7 @@
 Plain create with various options specified via usual cli arguments
 ===================================================================
   $ rbd create -s 1 test
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -13,7 +13,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 --object-size 1M test
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -25,7 +25,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1G --object-size 4K test
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -37,7 +37,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -54,7 +54,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1G test --image-format 2
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -71,7 +71,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2 --object-size 1M
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -88,7 +88,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -107,7 +107,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576B --stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -126,7 +126,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1G test --image-format 2 --stripe-unit 4K --stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -145,7 +145,7 @@ Plain create with various options specified via usual cli arguments
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1G test --image-format 2 --stripe-unit 1M --stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -167,7 +167,7 @@ Plain create with various options specified via usual cli arguments
 Format 2 Usual arguments with custom rbd_default_* params
 =========================================================
   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8 --rbd-default-order 21
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -186,7 +186,7 @@ Format 2 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2 --stripe-unit 1048576 --stripe-count 8 --object-size 8M --rbd-default-order 20
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -205,7 +205,7 @@ Format 2 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --image-format 2 --rbd-default-stripe-unit 1048576 --rbd-default-stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -227,7 +227,7 @@ Format 2 Usual arguments with custom rbd_default_* params
 Format 1 Usual arguments with custom rbd_default_* params
 =========================================================
   $ rbd create -s 1 test --rbd-default-order 20
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -239,7 +239,7 @@ Format 1 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --rbd-default-format 2
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -256,7 +256,7 @@ Format 1 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --rbd-default-format 2 --rbd-default-order 20
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -273,7 +273,7 @@ Format 1 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --rbd-default-format 2 --rbd-default-order 20 --rbd-default-features 1
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
@@ -290,7 +290,7 @@ Format 1 Usual arguments with custom rbd_default_* params
   }
   $ rbd rm test --no-progress
   $ rbd create -s 1 test --rbd-default-format 2 --stripe-unit 1048576 --stripe-count 8
-  $ rbd info test --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info test --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rbd_data.*",  (glob)
       "features": [
index 27ddfa6d4af84e1214f1bd1191cdc5d29c00df7a..9eba5d49e006f3fe2bd481e50c16305b01e96227 100644 (file)
@@ -61,7 +61,7 @@ For now, use a more inclusive regex.
   \tsnapshot_count: 1 (esc)
   [^^]+ (re)
   \tformat: 1 (esc)
-  $ rbd info foo --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info foo --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -95,7 +95,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   [^^]+ (re)
   \tformat: 1 (esc)
   \tprotected: False (esc)
-  $ rbd info foo@snap --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info foo@snap --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -135,7 +135,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tcreate_timestamp:* (glob)
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
-  $ rbd info bar --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info bar --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -198,7 +198,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
   \tprotected: True (esc)
-  $ rbd info bar@snap --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info bar@snap --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -263,7 +263,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
   \tprotected: False (esc)
-  $ rbd info bar@snap2 --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info bar@snap2 --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -327,7 +327,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tcreate_timestamp:* (glob)
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
-  $ rbd info baz --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info baz --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -374,7 +374,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tsnapshot_count: 0 (esc)
   [^^]+ (re)
   \tformat: 1 (esc)
-  $ rbd info quux --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info quux --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "block_name_prefix": "rb.0.*",  (glob)
       "format": 1, 
@@ -412,7 +412,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tcreate_timestamp:* (glob)
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
-  $ rbd info rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info rbd_other/child --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -475,7 +475,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tprotected: False (esc)
   \tparent: rbd/bar@snap (esc)
   \toverlap: 512 MiB (esc)
-  $ rbd info rbd_other/child@snap --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info rbd_other/child@snap --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -555,7 +555,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \tcreate_timestamp:* (glob)
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
-  $ rbd info rbd_other/deep-flatten-child --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info rbd_other/deep-flatten-child --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -618,7 +618,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   \taccess_timestamp:* (glob)
   \tmodify_timestamp:* (glob)
   \tprotected: False (esc)
-  $ rbd info rbd_other/deep-flatten-child@snap --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd info rbd_other/deep-flatten-child@snap --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "access_timestamp": "*",  (glob)
       "block_name_prefix": "rbd_data.*",  (glob)
@@ -674,7 +674,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   bar
   baz
   quuy
-  $ rbd list --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd list --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       "foo", 
       "quux", 
@@ -700,7 +700,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   bar@snap2   1 GiB          2           
   baz         2 GiB          2      shr  
   quuy        2 GiB          2           
-  $ rbd list -l --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd list -l --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "format": 1, 
@@ -827,7 +827,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   $ rbd list rbd_other
   child
   deep-flatten-child
-  $ rbd list rbd_other --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd list rbd_other --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       "child", 
       "deep-flatten-child"
@@ -843,7 +843,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   child@snap              512 MiB rbd/bar@snap   2           
   deep-flatten-child      512 MiB                2           
   deep-flatten-child@snap 512 MiB                2           
-  $ rbd list rbd_other -l --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd list rbd_other -l --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "format": 2, 
@@ -922,7 +922,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
     </snapshot>
   </images>
   $ rbd lock list foo
-  $ rbd lock list foo --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd lock list foo --format json | python3 -mjson.tool | sed 's/,$/, /'
   []
   $ rbd lock list foo --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp'
   <locks></locks>
@@ -930,7 +930,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   There is 1 exclusive lock on this image.
   Locker*ID*Address* (glob)
   client.* id * (glob)
-  $ rbd lock list quux --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd lock list quux --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "address": "*",  (glob)
@@ -953,7 +953,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   client.*id[123].* (re)
   client.*id[123].* (re)
   client.*id[123].* (re)
-  $ rbd lock list baz --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd lock list baz --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "address": "*",  (glob)
@@ -992,7 +992,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   $ rbd snap list foo
   SNAPID*NAME*SIZE*PROTECTED*TIMESTAMP* (glob)
   *snap*1 GiB* (glob)
-  $ rbd snap list foo --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd snap list foo --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "id": *,  (glob)
@@ -1016,7 +1016,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   SNAPID*NAME*SIZE*PROTECTED*TIMESTAMP* (glob)
   *snap*512 MiB*yes* (glob)
   *snap2*1 GiB* (glob)
-  $ rbd snap list bar --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd snap list bar --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "id": *,  (glob)
@@ -1051,14 +1051,14 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
     </snapshot>
   </snapshots>
   $ rbd snap list baz
-  $ rbd snap list baz --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd snap list baz --format json | python3 -mjson.tool | sed 's/,$/, /'
   []
   $ rbd snap list baz --format xml | xml_pp 2>&1 | grep -v '^new version at /usr/bin/xml_pp'
   <snapshots></snapshots>
   $ rbd snap list rbd_other/child
   SNAPID*NAME*SIZE*PROTECTED*TIMESTAMP* (glob)
   *snap*512 MiB* (glob)
-  $ rbd snap list rbd_other/child --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd snap list rbd_other/child --format json | python3 -mjson.tool | sed 's/,$/, /'
   [
       {
           "id": *,  (glob)
@@ -1085,7 +1085,7 @@ whenever it is run. grep -v to ignore it, but still work on other distros.
   deep-flatten-child@snap     512 MiB   0 B 
   deep-flatten-child          512 MiB   0 B 
   <TOTAL>                       1 GiB 4 MiB 
-  $ rbd disk-usage --pool rbd_other --format json | python -mjson.tool | sed 's/,$/, /'
+  $ rbd disk-usage --pool rbd_other --format json | python3 -mjson.tool | sed 's/,$/, /'
   {
       "images": [
           {
index 8dbbda24c1c1b8b3720320a74884c530cb858d4e..9738842b4c8c40e117cc5eacd3f3a94dbaaaeb33 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 Loop writing/reading the first 4k of image argv[1] in pool rbd,
 after acquiring exclusive lock named argv[2].  When an exception
index b7b934b5a73e24685463b693e8bb06250c5090d7..05864512ad7cb8963a4e17a7820ec5587cf77d10 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 import os
 import sys
 import time
index b0f99434c84d652ffed1bca77d949077804b4fa9..2a4bddb9db5635c866800c5842e42a6f98cb4b63 100644 (file)
@@ -18,31 +18,31 @@ function json_extract {
 var=""
 [ "$1" != "" ] && var=$(var_to_python_json_index $1)
 shift
-python - <<END
+python3 - <<END
 import json
 s='$@'
 data = json.loads(s) 
-print data$var
+print(data$var)
 END
 }
 
 function python_array_len {
-python - <<END
+python3 - <<END
 arr=$@
-print len(arr)
+print(len(arr))
 END
 }
 
 function project_python_array_field {
 var=$(var_to_python_json_index $1)
 shift
-python - <<END
+python3 - <<END
 arr=$@
 s='( '
 for x in arr:
     s += '"' + str(x$var) + '" '
 s += ')'
-print s
+print(s)
 END
 }