mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge pull request #128 from YunoHost/fix_installation
[fix] at installation the cache dir might not be present
This commit is contained in:
commit
8404b03c87
1 changed files with 6 additions and 4 deletions
|
@ -523,10 +523,12 @@ class ActionsMap(object):
|
|||
with open(am_file, 'r') as f:
|
||||
actionsmaps[n] = yaml.load(f)
|
||||
|
||||
# clean old cached files
|
||||
for i in os.listdir('%s/actionsmap/' % pkg.cachedir):
|
||||
if i.endswith(".pkl"):
|
||||
os.remove('%s/actionsmap/%s' % (pkg.cachedir, i))
|
||||
# at installation, cachedir might not exists
|
||||
if os.path.exists('%s/actionsmap/' % pkg.cachedir):
|
||||
# clean old cached files
|
||||
for i in os.listdir('%s/actionsmap/' % pkg.cachedir):
|
||||
if i.endswith(".pkl"):
|
||||
os.remove('%s/actionsmap/%s' % (pkg.cachedir, i))
|
||||
|
||||
# Cache actions map into pickle file
|
||||
am_file_stat = os.stat(am_file)
|
||||
|
|
Loading…
Reference in a new issue