summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gluster/swift/common/utils.py18
-rw-r--r--test/unit/common/test_utils.py34
2 files changed, 0 insertions, 52 deletions
diff --git a/gluster/swift/common/utils.py b/gluster/swift/common/utils.py
index 0b2ad28..f2e112a 100644
--- a/gluster/swift/common/utils.py
+++ b/gluster/swift/common/utils.py
@@ -168,24 +168,6 @@ def clean_metadata(path_or_fd):
key += 1
-def check_user_xattr(path):
- if not os_path.exists(path):
- return False
- try:
- xattr.setxattr(path, 'user.test.key1', 'value1')
- except IOError as err:
- raise GlusterFileSystemIOError(
- err.errno,
- 'xattr.setxattr("%s", "user.test.key1", "value1")' % (path,))
- try:
- xattr.removexattr(path, 'user.test.key1')
- except IOError as err:
- logging.exception("check_user_xattr: remove failed on %s err: %s",
- path, str(err))
- #Remove xattr may fail in case of concurrent remove.
- return True
-
-
def validate_container(metadata):
if not metadata:
logging.warn('validate_container: No metadata')
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py
index 2582558..dd03bd8 100644
--- a/test/unit/common/test_utils.py
+++ b/test/unit/common/test_utils.py
@@ -630,40 +630,6 @@ class TestUtils(unittest.TestCase):
os.chdir(orig_cwd)
shutil.rmtree(td)
- def test_check_user_xattr_bad_path(self):
- assert False == utils.check_user_xattr("/tmp/foo/bar/check/user/xattr")
-
- def test_check_user_xattr_bad_set(self):
- td = tempfile.mkdtemp()
- xkey = _xkey(td, 'user.test.key1')
- _xattr_set_err[xkey] = errno.EOPNOTSUPP
- try:
- assert False == utils.check_user_xattr(td)
- except IOError:
- pass
- else:
- self.fail("Expected IOError")
- finally:
- shutil.rmtree(td)
-
- def test_check_user_xattr_bad_remove(self):
- td = tempfile.mkdtemp()
- xkey = _xkey(td, 'user.test.key1')
- _xattr_rem_err[xkey] = errno.EOPNOTSUPP
- try:
- utils.check_user_xattr(td)
- except IOError:
- self.fail("Unexpected IOError")
- finally:
- shutil.rmtree(td)
-
- def test_check_user_xattr(self):
- td = tempfile.mkdtemp()
- try:
- assert utils.check_user_xattr(td)
- finally:
- shutil.rmtree(td)
-
def test_validate_container_empty(self):
ret = utils.validate_container({})
assert not ret