mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
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:
1 parent
de22c79665
commit
eb2b3bd86e
2 files changed
+18
-22
No files matched your search
+1
-5
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user