]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
doc/rgw: update to python3 print syntax
authorMichael Fritch <mfritch@suse.com>
Thu, 15 Apr 2021 21:34:02 +0000 (15:34 -0600)
committerMichael Fritch <mfritch@suse.com>
Thu, 15 Apr 2021 21:38:16 +0000 (15:38 -0600)
python3 requires parens for a `print` statement

Signed-off-by: Michael Fritch <mfritch@suse.com>
doc/radosgw/STSLite.rst
doc/radosgw/s3/python.rst
doc/radosgw/swift/python.rst
doc/radosgw/swift/tempurl.rst

index bccc1694e4767ddff197f67453349541a8c40432..c78c14e5005b3452c914b255da97e35ac58c8c85 100644 (file)
@@ -159,10 +159,10 @@ Keystone.
     bucket = s3client.create_bucket(Bucket='my-new-shiny-bucket')
     response = s3client.list_buckets()
     for bucket in response["Buckets"]:
-        print "{name}\t{created}".format(
+        print("{name}\t{created}".format(
                     name = bucket['Name'],
                     created = bucket['CreationDate'],
-    )
+        ))
 
 Similar steps can be performed for using GetSessionToken with LDAP.
 
index 4b9faef1186e08fe97171de8b618c6d9412e9792..9f9367e0fcb03f629f2f94554feefc4d8655c41b 100644 (file)
@@ -33,10 +33,10 @@ This also prints out the bucket name and creation date of each bucket.
 .. code-block:: python
 
        for bucket in conn.get_all_buckets():
-               print "{name}\t{created}".format(
+               print("{name}\t{created}".format(
                        name = bucket.name,
                        created = bucket.creation_date,
-               )
+               ))
 
 The output will look something like this::
 
@@ -65,11 +65,11 @@ modified date.
 .. code-block:: python
 
        for key in bucket.list():
-               print "{name}\t{size}\t{modified}".format(
+               print("{name}\t{size}\t{modified}".format(
                        name = key.name,
                        size = key.size,
                        modified = key.last_modified,
-                       )
+               ))
 
 The output will look something like this::
 
@@ -158,11 +158,11 @@ URL will stop working).
 
        hello_key = bucket.get_key('hello.txt')
        hello_url = hello_key.generate_url(0, query_auth=False, force_http=True)
-       print hello_url
+       print(hello_url)
 
        plans_key = bucket.get_key('secret_plans.txt')
        plans_url = plans_key.generate_url(3600, query_auth=True, force_http=True)
-       print plans_url
+       print(plans_url)
 
 The output of this will look something like::
 
@@ -177,7 +177,7 @@ For example, unordered list of objects could be fetched using:
 
 .. code-block:: python
 
-    print conn.list_objects(Bucket='my-new-bucket', AllowUnordered=True)
+    print(conn.list_objects(Bucket='my-new-bucket', AllowUnordered=True))
 
 
 Without the extensions file, in the above example, boto3 would complain that the ``AllowUnordered`` argument is invalid.
index 28d92d7cc9715d26ab86802ccf23fd93c3f280b6..0b1f8d0da862fff07660a0282245231e7b59025c 100644 (file)
@@ -54,7 +54,7 @@ This gets a list of containers that you own, and prints out the container name:
 .. code-block:: python
 
        for container in conn.get_account()[1]:
-               print container['name']
+               print(container['name'])
 
 The output will look something like this::
 
@@ -71,7 +71,7 @@ object's name, the file size, and last modified date:
 .. code-block:: python
 
        for data in conn.get_container(container_name)[1]:
-               print '{0}\t{1}\t{2}'.format(data['name'], data['bytes'], data['last_modified'])
+               print('{0}\t{1}\t{2}'.format(data['name'], data['bytes'], data['last_modified']))
 
 The output will look something like this::
 
index 79b392de62269787d3256f2e86bc257a1e71df3b..41dbb0ccb85669cba0db5dbaa88dd8f69b166e0b 100644 (file)
@@ -95,7 +95,7 @@ A sample python script to demonstrate the above is given below:
    sig = hmac.new(key, hmac_body, sha1).hexdigest()
    rest_uri = "{host}{path}?temp_url_sig={sig}&temp_url_expires={expires}".format(
                host=host, path=path, sig=sig, expires=expires)
-   print rest_uri
+   print(rest_uri)
 
    # Example Output
    # https://objectstore.example.com/swift/v1/your-bucket/your-object?temp_url_sig=ff4657876227fc6025f04fcf1e82818266d022c6&temp_url_expires=1423200992