mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Added the ability to disable the output of errors when caching
This commit is contained in:
parent
cdfc39540f
commit
5015da40b7
@ -105,7 +105,7 @@ def get_list_all_files(files, file_cache, username = None):
|
||||
dict_files_cp['suppress'] = file_obj.suppress
|
||||
if fromPath and fromPath[-1] != '*':
|
||||
try:
|
||||
file_cache.store(fromPath)
|
||||
file_cache.store(fromPath, False)
|
||||
dict_files_cp['fromPath'] = file_cache.get(fromPath)
|
||||
ls_files_cp.append(Files_cp(dict_files_cp))
|
||||
except Exception as exc:
|
||||
|
@ -39,7 +39,7 @@ class fs_file_cache:
|
||||
self.samba_context = smbc.Context(use_kerberos=1)
|
||||
#, debug=10)
|
||||
|
||||
def store(self, uri):
|
||||
def store(self, uri, log_enable = True):
|
||||
destdir = uri
|
||||
try:
|
||||
uri_path = UNCPath(uri)
|
||||
@ -72,8 +72,9 @@ class fs_file_cache:
|
||||
df.write(data)
|
||||
df.flush()
|
||||
except Exception as exc:
|
||||
logdata = dict({'exception': str(exc)})
|
||||
log('E35', logdata)
|
||||
if log_enable:
|
||||
logdata = dict({'exception': str(exc)})
|
||||
log('E35', logdata)
|
||||
raise exc
|
||||
|
||||
def get(self, uri):
|
||||
|
Loading…
x
Reference in New Issue
Block a user