publisher: skip directories when importing from a zipfile (#6787)
This commit is contained in:
parent
82627cdc8c
commit
23ea72da85
|
@ -144,9 +144,12 @@ class WcsPublisher(StubWcsPublisher):
|
|||
results = {'formdefs': 0, 'workflows': 0, 'categories': 0, 'roles': 0, 'settings': 0}
|
||||
for f in z.namelist():
|
||||
path = os.path.join(self.app_dir, f)
|
||||
data = z.read(f)
|
||||
if not os.path.exists(os.path.dirname(path)):
|
||||
os.mkdir(os.path.dirname(path))
|
||||
if not os.path.basename(f):
|
||||
# skip directories
|
||||
continue
|
||||
data = z.read(f)
|
||||
if f == 'config.pck':
|
||||
results['settings'] = 1
|
||||
d = cPickle.loads(data)
|
||||
|
|
Loading…
Reference in New Issue