From 86f80b770b06a76551cc50371f0f5ab8c55cfb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Thu, 12 Apr 2018 10:33:12 +0200 Subject: [PATCH] Install python3-openssl if not already installed. --- tests/test_ssl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_ssl.py b/tests/test_ssl.py index ade1e7b5..f83ac4b8 100755 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -7,12 +7,18 @@ Checks that TLS certificates are valid; if invalid, the user will have to add an ''' import datetime import imp -import OpenSSL import os import requests import sys import ssl +try: + import OpenSSL +except ImportError: + import subprocess + subprocess.call(['apt-get', '-qq', '-y', 'install', 'python3-openssl']) + import OpenSSL + YELLOW = '\033[93m' GREEN = '\033[92m' RED = '\033[91m' -- GitLab