projects
/
mdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69730d4
)
Backup command fails when the backup directory is missing
author
Frederic Massart
<fred@moodle.com>
Wed, 5 Nov 2014 05:11:14 +0000
(13:11 +0800)
committer
Frederic Massart
<fred@moodle.com>
Wed, 5 Nov 2014 05:11:14 +0000
(13:11 +0800)
mdk/backup.py
patch
|
blob
|
history
diff --git
a/mdk/backup.py
b/mdk/backup.py
index
856e9f1
..
3b34a23
100644
(file)
--- a/
mdk/backup.py
+++ b/
mdk/backup.py
@@
-28,7
+28,7
@@
import time
import logging
from distutils.dir_util import copy_tree
-from .tools import chmodRecursive
+from .tools import chmodRecursive
, mkdir
from .db import DB
from .config import Conf
from .workplace import Workplace
@@
-43,6
+43,8
@@
class BackupManager(object):
def __init__(self):
self.path = os.path.expanduser(os.path.join(C.get('dirs.moodle'), 'backup'))
+ if not os.path.exists(self.path):
+ mkdir(self.path, 0777)
def create(self, M):
"""Creates a new backup of M"""