diff options
author | Matthew Thode <prometheanfire@gentoo.org> | 2018-03-17 15:22:38 -0500 |
---|---|---|
committer | Matthew Thode <prometheanfire@gentoo.org> | 2018-03-17 15:23:20 -0500 |
commit | b4abf82e5c60c00d7f5753f46002eae485315019 (patch) | |
tree | 2b41ee7a0f0cdba4121486bf1d421e9451c9216e /app-crypt | |
parent | app-crypt/gnupg-2.2.4-r2: ppc64 stable, bug 646934 (diff) | |
download | gentoo-b4abf82e5c60c00d7f5753f46002eae485315019.tar.gz gentoo-b4abf82e5c60c00d7f5753f46002eae485315019.tar.bz2 gentoo-b4abf82e5c60c00d7f5753f46002eae485315019.zip |
app-crypt/acme: fixing client regression
Closes: https://bugs.gentoo.org/650604
Package-Manager: Portage-2.3.24, Repoman-2.3.6
Diffstat (limited to 'app-crypt')
-rw-r--r-- | app-crypt/acme/acme-0.22.0-r1.ebuild (renamed from app-crypt/acme/acme-0.22.0.ebuild) | 2 | ||||
-rw-r--r-- | app-crypt/acme/files/0.22.0-fix-client.patch | 55 |
2 files changed, 57 insertions, 0 deletions
diff --git a/app-crypt/acme/acme-0.22.0.ebuild b/app-crypt/acme/acme-0.22.0-r1.ebuild index 610350856377..dd86db57739c 100644 --- a/app-crypt/acme/acme-0.22.0.ebuild +++ b/app-crypt/acme/acme-0.22.0-r1.ebuild @@ -42,6 +42,8 @@ DEPEND=" >=dev-python/setuptools-1.0[${PYTHON_USEDEP}] " +PATCHES=( "${FILESDIR}/0.22.0-fix-client.patch" ) + python_test() { nosetests -w ${PN} || die } diff --git a/app-crypt/acme/files/0.22.0-fix-client.patch b/app-crypt/acme/files/0.22.0-fix-client.patch new file mode 100644 index 000000000000..589781b0a8d5 --- /dev/null +++ b/app-crypt/acme/files/0.22.0-fix-client.patch @@ -0,0 +1,55 @@ +From 0131c649d057a513a6bdc0b4b6eac7ea0bd9a9e8 Mon Sep 17 00:00:00 2001 +From: Brad Warren <bmw@users.noreply.github.com> +Date: Fri, 16 Mar 2018 18:44:23 -0700 +Subject: [PATCH] Fix acme.client.Client.__init__ (#5747) (#5748) + +* fixes #5738 + +* add test to prevent regressions + +(cherry picked from commit ba6bdb50998bd55aeef7972a5c839560e02142f3) +--- + acme/acme/client.py | 5 +++-- + acme/acme/client_test.py | 10 ++++++++++ + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git acme/acme/client.py acme/acme/client.py +index 9e2478afe4..19615b087b 100644 +--- acme/acme/client.py ++++ acme/acme/client.py +@@ -259,11 +259,12 @@ def __init__(self, directory, key, alg=jose.RS256, verify_ssl=True, + """ + # pylint: disable=too-many-arguments + self.key = key +- self.net = ClientNetwork(key, alg=alg, verify_ssl=verify_ssl) if net is None else net ++ if net is None: ++ net = ClientNetwork(key, alg=alg, verify_ssl=verify_ssl) + + if isinstance(directory, six.string_types): + directory = messages.Directory.from_json( +- self.net.get(directory).json()) ++ net.get(directory).json()) + super(Client, self).__init__(directory=directory, + net=net, acme_version=1) + +diff --git acme/acme/client_test.py acme/acme/client_test.py +index 00b9e19dd0..be08c2919f 100644 +--- acme/acme/client_test.py ++++ acme/acme/client_test.py +@@ -299,6 +299,16 @@ def test_init_downloads_directory(self): + directory=uri, key=KEY, alg=jose.RS256, net=self.net) + self.net.get.assert_called_once_with(uri) + ++ @mock.patch('acme.client.ClientNetwork') ++ def test_init_without_net(self, mock_net): ++ mock_net.return_value = mock.sentinel.net ++ alg = jose.RS256 ++ from acme.client import Client ++ self.client = Client( ++ directory=self.directory, key=KEY, alg=alg) ++ mock_net.called_once_with(KEY, alg=alg, verify_ssl=True) ++ self.assertEqual(self.client.net, mock.sentinel.net) ++ + def test_register(self): + # "Instance of 'Field' has no to_json/update member" bug: + # pylint: disable=no-member |