From 7fe63b9f193cd729ef71f144aea4febeba9ccc89 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 9 Sep 2019 14:19:03 -0500 Subject: [PATCH] Install python3-certbot-apache for debian 10 when applicable --- rattail_fabric2/certbot.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rattail_fabric2/certbot.py b/rattail_fabric2/certbot.py index 8ff797d..e5ab273 100644 --- a/rattail_fabric2/certbot.py +++ b/rattail_fabric2/certbot.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2019 Lance Edgar # # This file is part of Rattail. # @@ -24,8 +24,6 @@ Fabric library for Let's Encrypt certbot """ -from __future__ import unicode_literals, absolute_import - from rattail_fabric2 import apt, exists, get_debian_version @@ -52,8 +50,8 @@ def install(c, source=False, service='apache'): apt.add_source(c, 'deb http://ftp.debian.org/debian jessie-backports main') apt.install(c, 'python-certbot-apache', target_release='jessie-backports') - # debian 9 stretch, or later - elif version >= 9: + # debian 9 stretch + elif 9 <= version < 10: if service == 'apache': apt.install(c, 'python-certbot-apache') elif service == 'nginx': @@ -61,6 +59,15 @@ def install(c, source=False, service='apache'): else: raise NotImplementedError("unknown web service: {}".format(service)) + # debian 10 buster, or later + elif version >= 10: + if service == 'apache': + apt.install(c, 'python3-certbot-apache') + elif service == 'nginx': + apt.install(c, 'python3-certbot-nginx') + else: + raise NotImplementedError("unknown web service: {}".format(service)) + # other..? will have to investigate when this comes up else: raise NotImplementedError("don't know how to install certbot on debian version {}".format(version))