0
0
Fork 0

[postprocessor/xattr] Clarify NO_SPACE message (#14970)

main
Sergey M․ 2017-12-14 01:00:14 +07:00
parent 6bf9c28b0a
commit 7974e289a1
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 4 additions and 2 deletions

View File

@ -42,6 +42,7 @@ class XAttrMetadataPP(PostProcessor):
'user.dublincore.format': 'format', 'user.dublincore.format': 'format',
} }
num_written = 0
for xattrname, infoname in xattr_mapping.items(): for xattrname, infoname in xattr_mapping.items():
value = info.get(infoname) value = info.get(infoname)
@ -52,6 +53,7 @@ class XAttrMetadataPP(PostProcessor):
byte_value = value.encode('utf-8') byte_value = value.encode('utf-8')
write_xattr(filename, xattrname, byte_value) write_xattr(filename, xattrname, byte_value)
num_written += 1
return [], info return [], info
@ -62,8 +64,8 @@ class XAttrMetadataPP(PostProcessor):
except XAttrMetadataError as e: except XAttrMetadataError as e:
if e.reason == 'NO_SPACE': if e.reason == 'NO_SPACE':
self._downloader.report_warning( self._downloader.report_warning(
'There\'s no disk space left or disk quota exceeded. ' + 'There\'s no disk space left, disk quota exceeded or filesystem xattr limit exceeded. ' +
'Extended attributes are not written.') (('Some ' if num_written else '') + 'extended attributes are not written.').capitalize())
elif e.reason == 'VALUE_TOO_LONG': elif e.reason == 'VALUE_TOO_LONG':
self._downloader.report_warning( self._downloader.report_warning(
'Unable to write extended attributes due to too long values.') 'Unable to write extended attributes due to too long values.')