removing check_user_xattr function

This function is no longer used, the code that called
this function was removed as part of this patch:
http://review.gluster.com/#/c/3390/

Change-Id: I6e81e4b763ce302289e2be5467dc4776f0750c15
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7336
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
This commit is contained in:
Thiago da Silva 2014-03-25 14:53:12 -04:00 committed by Luis Pabon
parent 2014cdb906
commit 972c252c41
2 changed files with 0 additions and 52 deletions

View File

@ -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')

View File

@ -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