changeset 3361:43e60c40de65

core (memory/memory): fixed directory creation in setFile
author Goffi <goffi@goffi.org>
date Thu, 17 Sep 2020 21:40:23 +0200
parents 57afccb91961
children 02583a401e51
files sat/memory/memory.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/memory/memory.py	Thu Sep 17 19:01:02 2020 +0200
+++ b/sat/memory/memory.py	Thu Sep 17 21:40:23 2020 +0200
@@ -1568,6 +1568,7 @@
         @param path(unicode, None): virtual path of the file in the namespace
             if set, parent must be None. All intermediate directories will be created
             if needed, using current access.
+        @param type_(str, None): type of file filter, can be one of C.FILE_TYPE_*
         @param file_hash(unicode): unique hash of the payload
         @param hash_algo(unicode): algorithm used for hashing the file (usually sha-256)
         @param size(int): size in bytes
@@ -1623,7 +1624,7 @@
         if namespace is not None:
             namespace = namespace.strip() or None
         if type_ == C.FILE_TYPE_DIRECTORY:
-            if any(version, file_hash, size, mime_type):
+            if any((version, file_hash, size, mime_type)):
                 raise ValueError(
                     "version, file_hash, size and mime_type can't be set for a directory"
                 )