fixing bug in prep scripts
This commit is contained in:
parent
7df740a225
commit
7df5d78ec1
@ -257,10 +257,12 @@ class Backup(object):
|
||||
os.makedirs(tmpdir, exist_ok = True)
|
||||
os.chmod(tmpdir, mode = 0o0700)
|
||||
for idx, prep in enumerate(repo['prep']):
|
||||
exec_tmp = tempfile.mkstemp(prefix = '_borgextend.',
|
||||
exec_fd, exec_tmp = tempfile.mkstemp(prefix = '_borgextend.',
|
||||
suffix = '._tmpexc',
|
||||
text = True,
|
||||
dir = tmpdir)[1]
|
||||
# D'oh. I need to close the FD before messing with it.
|
||||
os.close(exec_fd)
|
||||
os.chmod(exec_tmp, mode = 0o0700)
|
||||
with open(exec_tmp, 'w') as f:
|
||||
f.write(prep)
|
||||
|
Loading…
Reference in New Issue
Block a user