From 7e359fa9bae682d7134ce87d88827c96d6e873fa Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 10 Sep 2015 19:38:52 +0300 Subject: Don't see if root is file, it isn't We do not, in fact, currently support the live data root being a non-directory. The code removed here assumes it can be (it can't, neither LocalFS nor the SFTP plugin support it), and (sometimes) gets the check for whether it is wrong, resulting in backing up the parent directory instead, breaking things and confusing people. --- obnamlib/plugins/backup_plugin.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py index 71fd839e..3b4b2729 100644 --- a/obnamlib/plugins/backup_plugin.py +++ b/obnamlib/plugins/backup_plugin.py @@ -460,16 +460,8 @@ class BackupPlugin(obnamlib.ObnamPlugin): self.open_or_reopen_fs(self.fs.reinit, root_url) def open_or_reopen_fs(self, func, root_url): - scheme, netloc, path, params, query, fragment = \ - urlparse.urlparse(root_url) - try: func(root_url) - if not self.fs.isdir(path): - parent_path = os.path.dirname(path) - parent_url = urlparse.urlunparse( - (scheme, netloc, parent_path, params, query, fragment)) - self.fs.reinit(parent_url) except OSError as e: if e.errno == errno.ENOENT: raise BackupRootDoesNotExist(root=root_url) -- cgit v1.2.1