summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-02-25 08:45:16 +0000
committerLars Wirzenius <liw@liw.fi>2014-02-25 08:45:16 +0000
commitb7512ada93c2de80f3be6374bc7c32643c61940e (patch)
tree48a5f7ddeb042c73c4a1f36cc3b1cd7479485e1f
parentd2489623d055746354ab3023aec7f43ccde3b84d (diff)
downloadobnam-b7512ada93c2de80f3be6374bc7c32643c61940e.tar.gz
RE-instate chdir in re-opening repo
Valery pointed out to me that FUSE itself does a chdir, so we do need to chdir back to where we were when re-opening.
-rw-r--r--obnamlib/plugins/fuse_plugin.py12
-rw-r--r--test-gpghome/random_seedbin600 -> 600 bytes
2 files changed, 12 insertions, 0 deletions
diff --git a/obnamlib/plugins/fuse_plugin.py b/obnamlib/plugins/fuse_plugin.py
index 0f287381..9ff6eaae 100644
--- a/obnamlib/plugins/fuse_plugin.py
+++ b/obnamlib/plugins/fuse_plugin.py
@@ -582,6 +582,13 @@ class MountPlugin(obnamlib.ObnamPlugin):
self.app.settings.require('client-name')
self.app.settings.require('to')
+ # Remember the current working directory. FUSE will change
+ # the current working directory to / when it backgrounds itself,
+ # and this can break a --repository setting value that is a
+ # relative pathname. When we re-open the repository, we'll first
+ # chdir to where we are now, so this doesn't break.
+ self.cwd = os.getcwd()
+
self.repo = self.app.get_repository_object()
logging.debug(
@@ -604,4 +611,9 @@ class MountPlugin(obnamlib.ObnamPlugin):
def reopen(self):
self.repo.close()
+
+ # Change to original working directory, to allow relative paths
+ # for --repository to work correctly.
+ os.chdir(self.cwd)
+
self.repo = self.app.get_repository_object()
diff --git a/test-gpghome/random_seed b/test-gpghome/random_seed
index b085e2d2..318f1a41 100644
--- a/test-gpghome/random_seed
+++ b/test-gpghome/random_seed
Binary files differ