From e5c2442ffb7316d15586c74cfbd78551c9f1f3e9 Mon Sep 17 00:00:00 2001 From: Trevor Benson Date: Sat, 16 Dec 2023 11:04:15 -0800 Subject: [PATCH] Review suggestions Will reword/fixup for contribution guidlines after build and tests Signed-off-by: Trevor Benson --- debian/control | 2 +- snap/snapcraft.yaml | 1 + sos/policies/distros/__init__.py | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 0ca62874e7..678b82145f 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,7 @@ Vcs-Git: https://salsa.debian.org/sosreport-team/sosreport.git Package: sosreport Architecture: any -Depends: ${python3:Depends}, ${misc:Depends}, python3-pexpect, python3-magic, python3-packaging +Depends: ${python3:Depends}, ${misc:Depends}, python3-pexpect, python3-magic, python3-packaging, python3-boto3 Description: Set of tools to gather troubleshooting data from a system Sos is a set of tools that gathers information about system hardware and configuration. The information can then be used for diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index dc3b43e2dc..e4c548c393 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -37,6 +37,7 @@ parts: - wheel - python_magic - packaging + - boto3 apps: sos: diff --git a/sos/policies/distros/__init__.py b/sos/policies/distros/__init__.py index 699aa3f99b..bd6d812a0f 100644 --- a/sos/policies/distros/__init__.py +++ b/sos/policies/distros/__init__.py @@ -8,7 +8,6 @@ # # See the LICENSE file in the source distribution for further information. -import boto3 import os import re @@ -33,6 +32,12 @@ except ImportError: REQUESTS_LOADED = False +try: + import boto3 + BOTO3_LOADED = True +except ImportError: + BOTO3_LOADED = False + # Container environment variables for detecting if we're in a container ENV_CONTAINER = 'container' ENV_HOST_SYSROOT = 'HOST'