backups: Minor refactoring

- Mark some methods private.

- Fix some flake8 warnings.

- Remove unused exception.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-02-03 17:00:29 -05:00
1 parent de22c79665
commit eb2b3bd86e
2 files changed
+18 -22

No files matched your search

+1 -5
View File
@@ -32,10 +32,6 @@ from plinth.modules.backups import MANIFESTS_FOLDER
TIMEOUT = 5
class AlreadyMountedError(Exception):
pass
def parse_arguments():
"""Return parsed command line arguments as dictionary."""
parser = argparse.ArgumentParser()
@@ -103,7 +99,7 @@ def subcommand_setup(arguments):
"""Create repository if it does not already exist."""
try:
run(['borg', 'info', arguments.path], arguments=arguments, check=True)
except:
except subprocess.CalledProcessError:
path = os.path.dirname(arguments.path)
if not os.path.exists(path):
os.makedirs(path)