Do not return second parameter in unpack_zip_archive_in_memory

Change-Id: Ic2d54f7e52d1fcfb0041384b281be8053b23f477
This commit is contained in:
Mike Fedosin 2017-07-25 18:12:50 +03:00
parent dbdd286346
commit dfeab5255c
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ def unpack_zip_archive_in_memory(context, af, field_name, fd):
:param af: artifact object
:param field_name: blob dict name where to unpack the data
:param fd: zip archive
:return io.BytesIO object - simple stream of in-memory bytes, None
:return io.BytesIO object - simple stream of in-memory bytes
"""
# Warning: usage of this function is potentially harmful, because it
# doesn't limit how much data it writes to ram. Careless usage in artifact
@ -130,4 +130,4 @@ def unpack_zip_archive_in_memory(context, af, field_name, fd):
context, af, utils.BlobIterator(zip_ref.read(name)),
field_name, name)
flobj.seek(0)
return flobj, None
return flobj

View File

@ -91,7 +91,7 @@ class HookChecker(base.BaseArtifact):
def validate_upload(cls, context, af, field_name, fd):
if CONF.hooks_artifact.in_memory_processing:
return file_utils.unpack_zip_archive_in_memory(
context, af, 'content', fd)
context, af, 'content', fd), None
else:
return cls._validate_upload_harddrive(
context, af, field_name, fd)