From f5c8b6748014f0a8a5d8d776ea5ba9605ee0a8a9 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 31 May 2023 13:22:31 +0200 Subject: [PATCH] Exit when no backend available --- npbackup/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npbackup/__main__.py b/npbackup/__main__.py index 8d4a775..05c0b5f 100644 --- a/npbackup/__main__.py +++ b/npbackup/__main__.py @@ -406,8 +406,11 @@ This is free software, and you are welcome to redistribute it under certain cond npbackup_runner = NPBackupRunner(config_dict=config_dict) npbackup_runner.dry_run = dry_run npbackup_runner.verbose = _VERBOSE + if npbackup_runner.backend_version: + logger.critical("No backend available. Cannot continue") + sys.exit(25) logger.info("Backend: {}".format(npbackup_runner.backend_version)) - + if args.check: if npbackup_runner.check_recent_backups(): sys.exit(0)