mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
modules.archive.unzip: log a warning about perms
See https://bugs.python.org/issue15795.
This commit is contained in:
parent
3dd2590e28
commit
928a7891b4
@ -6,6 +6,7 @@ A module to wrap (non-Windows) archive calls
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import logging
|
||||
import contextlib # For < 2.7 compat
|
||||
|
||||
# Import salt libs
|
||||
@ -20,6 +21,8 @@ __func_alias__ = {
|
||||
'zip_': 'zip'
|
||||
}
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
HAS_ZIPFILE = False
|
||||
try:
|
||||
@ -518,6 +521,12 @@ def unzip(zip_file, dest, excludes=None,
|
||||
|
||||
salt '*' archive.unzip /tmp/zipfile.zip /home/strongbad/ password='BadPassword'
|
||||
'''
|
||||
# https://bugs.python.org/issue15795
|
||||
log.warning('Due to bug 15795 in python\'s zip lib, the permissions of the'
|
||||
' extracted files may not be preserved when using archive.unzip')
|
||||
log.warning('To preserve the permissions of extracted files, use'
|
||||
' archive.cmd_unzip')
|
||||
|
||||
if not excludes:
|
||||
excludes = []
|
||||
if runas:
|
||||
|
Loading…
Reference in New Issue
Block a user