]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
test/pybind/test_rados: always pass bytes to rados.Object.set_xattr()
authorKefu Chai <kchai@redhat.com>
Tue, 22 Oct 2019 04:44:35 +0000 (12:44 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 22 Oct 2019 08:05:26 +0000 (16:05 +0800)
commitb9f7a6534bc41e6c0851c6ddc27256fd711bcc7f
treec765f61bc88f1779ab7116756aa0d304ef38e92c
parentc039d776616f644c42d8cdb6b6083c75c6d8e6ee
test/pybind/test_rados: always pass bytes to rados.Object.set_xattr()

> an empty '' is of type str, not bytes.

python3 says. so let's be more explicit.

this change address failures like:
```
======================================================================
ERROR: test_rados.TestIoctx.test_obj_xattrs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in
runTest
    self.test(*self.arg)
  File "/var/ssd/ceph/src/test/pybind/test_rados.py", line 380, in
test_obj_xattrs
    obj.set_xattr(key, value)
  File "rados.pyx", line 4119, in rados.set_object_locator.retfunc
  File "rados.pyx", line 4129, in rados.set_object_namespace.retfunc
  File "rados.pyx", line 4204, in rados.Object.set_xattr
  File "rados.pyx", line 572, in rados.requires.wrapper.validate_func
  File "rados.pyx", line 560, in rados.requires.check_type
TypeError: xattr_value must be bytes
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/pybind/test_rados.py