15 lines
436 B
Python
15 lines
436 B
Python
|
from util.config.validator import EXTRA_CA_DIRECTORY
|
||
|
|
||
|
def tarinfo_filter_partial(prefix):
|
||
|
def tarinfo_filter(tarinfo):
|
||
|
# remove leading directory info
|
||
|
tarinfo.name = tarinfo.name.replace(prefix, '')
|
||
|
|
||
|
# ignore any directory that isn't the specified extra ca one:
|
||
|
if tarinfo.isdir() and not tarinfo.name == EXTRA_CA_DIRECTORY:
|
||
|
return None
|
||
|
|
||
|
return tarinfo
|
||
|
|
||
|
return tarinfo_filter
|