]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: type convert uid and gid to int
authorRamana Raja <rraja@redhat.com>
Mon, 10 Feb 2020 17:05:59 +0000 (12:05 -0500)
committerRamana Raja <rraja@redhat.com>
Wed, 12 Feb 2020 10:12:00 +0000 (05:12 -0500)
This fix is only needed in nautilus, and the issue
was observed during upstream teuthology testing.

   File "/usr/share/ceph/mgr/volumes/fs/async_cloner.py", line 114, in cptree
     copy_file(fs_handle, d_full_src, d_full_dst, mo, st.st_uid, st.st_gid)
   File "/usr/share/ceph/mgr/volumes/fs/fs_util.py", line 97, in copy_file
     fs.chown(dst, uid, gid)
   File "cephfs.pyx", line 855, in cephfs.LibCephFS.chown
      TypeError: uid must be an int

The issue wasn't observed in master/octopus teuthology
testing.

Signed-off-by: Ramana Raja <rraja@redhat.com>
src/pybind/mgr/volumes/fs/async_cloner.py

index c67dbde1abef33d858a253e27b7fce9d88333f89..6554a1c34ca810cb7039e474ac47ce841c9c4df7 100644 (file)
@@ -96,7 +96,7 @@ def bulk_copy(fs_handle, source_path, dst_path, should_cancel):
                             log.debug("cptree: (DIR) {0}".format(d_full_src))
                             try:
                                 fs_handle.mkdir(d_full_dst, mo)
-                                fs_handle.chown(d_full_dst, st.st_uid, st.st_gid)
+                                fs_handle.chown(d_full_dst, int(st.st_uid), int(st.st_gid))
                             except cephfs.Error as e:
                                 if not e.args[0] == errno.EEXIST:
                                     raise
@@ -111,7 +111,7 @@ def bulk_copy(fs_handle, source_path, dst_path, should_cancel):
                                     raise
                         elif stat.S_ISREG(st.st_mode):
                             log.debug("cptree: (REG) {0}".format(d_full_src))
-                            copy_file(fs_handle, d_full_src, d_full_dst, mo, st.st_uid, st.st_gid)
+                            copy_file(fs_handle, d_full_src, d_full_dst, mo, int(st.st_uid), int(st.st_gid))
                         else:
                             log.warn("cptree: (IGNORE) {0}".format(d_full_src))
                     d = fs_handle.readdir(dir_handle)