From 221e1a5bace83c3a1e7f404d4dcee9a5cafe013e Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Wed, 27 Nov 2019 18:35:13 +0100 Subject: [PATCH] Improve error in cloud clients when boto3 is missing Signed-off-by: Marco Nenciarini Signed-off-by: Gabriele Bartolini --- barman/cloud.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/barman/cloud.py b/barman/cloud.py index 004886a40..8f1fe56a9 100644 --- a/barman/cloud.py +++ b/barman/cloud.py @@ -30,15 +30,18 @@ from io import BytesIO from tempfile import NamedTemporaryFile -import boto3 -from botocore.exceptions import ClientError, EndpointConnectionError - from barman.backup_executor import ConcurrentBackupStrategy from barman.fs import path_allowed from barman.infofile import BackupInfo from barman.postgres_plumbing import EXCLUDE_LIST, PGDATA_EXCLUDE_LIST from barman.utils import force_str, human_readable_timedelta, total_seconds +try: + import boto3 + from botocore.exceptions import ClientError, EndpointConnectionError +except ImportError: + raise SystemExit("Missing required python module: boto3") + try: # Python 3.x from urllib.parse import urlparse