]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: use python3 compatible print
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 7 Oct 2019 14:09:45 +0000 (16:09 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Tue, 8 Oct 2019 14:03:32 +0000 (16:03 +0200)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
src/ceph-volume/ceph_volume/decorators.py
src/ceph-volume/ceph_volume/util/disk.py

index f6777281795b26a8622f21d9c54054150363d48e..95acce064fe184172440971074e0fe7e97a378b1 100644 (file)
@@ -29,9 +29,9 @@ def catches(catch=None, handler=None, exit=True):
         def bar():
             try:
                 some_call()
-                print "Success!"
+                print("Success!")
             except TypeError, exc:
-                print "Error while handling some call: %s" % exc
+                print("Error while handling some call: %s" % exc)
                 sys.exit(1)
 
     You would need to decorate it like this to have the same effect::
@@ -39,7 +39,7 @@ def catches(catch=None, handler=None, exit=True):
         @catches(TypeError)
         def bar():
             some_call()
-            print "Success!"
+            print("Success!")
 
     If multiple exceptions need to be caught they need to be provided as a
     tuple::
@@ -47,7 +47,7 @@ def catches(catch=None, handler=None, exit=True):
         @catches((TypeError, AttributeError))
         def bar():
             some_call()
-            print "Success!"
+            print("Success!")
     """
     catch = catch or Exception
 
index 97799466434c5d2cdd7c1a9337655e6182b2e82f..ab26359d929843e731974ac963bfe57b56f1c929 100644 (file)
@@ -534,9 +534,9 @@ class Size(object):
         <Size(2.16 GB)>
         >>> s.mb
         <FloatMB(2211.0)>
-        >>> print "Total size: %s" % s.mb
+        >>> print("Total size: %s" % s.mb)
         Total size: 2211.00 MB
-        >>> print "Total size: %s" % s
+        >>> print("Total size: %s" % s)
         Total size: 2.16 GB
     """