def clear_rp(self, rp):
"""Delete all the extended attributes in rpath"""
try:
for name in rp.conn.xattr.listxattr(encode(rp.path),
rp.issym()):
try:
rp.conn.xattr.removexattr(encode(rp.path),
name, rp.issym())
except IOError, exc:
# SELinux attributes cannot be removed, and we don't want
# to bail out or be too noisy at low log levels.
if exc[0] == errno.EACCES:
log.Log("Warning: unable to remove xattr %s from %s"
% (name, repr(rp.path)), 7)
continue
else: raise
except IOError, exc:
if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
return # if not supported, consider empty
elif exc[0] == errno.ENOENT: # path is bad
log.Log("Warning: unable to clear xattrs on %s: %s" %
(repr(rp.path), exc), 3)
return
else: raise
评论列表
文章目录