From f25a9b2004a8085eaca6019042b4b12e1570dd70 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Wed, 5 Jun 2019 14:00:54 -0700 Subject: [PATCH 1/7] Add contents to CHANGELOG.md for next version --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95833ad7b..3ad479282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). +## 0.36.0 - master + +### Added + +* + +### Changed + +* + +### Fixed + +* + +Despite us having broken lockstep, we are continuing to release new versions of +all Certbot components during releases for the time being, however, the only +package with changes other than its version number was: + +* + +More details about these changes can be found on our GitHub repo. + ## 0.35.0 - 2019-06-05 ### Added From f3b73c4d2a36249054fd39635eb326f514a9e6ab Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Wed, 5 Jun 2019 14:00:54 -0700 Subject: [PATCH 2/7] Bump version to 0.36.0 --- acme/setup.py | 2 +- certbot-apache/setup.py | 2 +- certbot-compatibility-test/setup.py | 2 +- certbot-dns-cloudflare/setup.py | 2 +- certbot-dns-cloudxns/setup.py | 2 +- certbot-dns-digitalocean/setup.py | 2 +- certbot-dns-dnsimple/setup.py | 2 +- certbot-dns-dnsmadeeasy/setup.py | 2 +- certbot-dns-gehirn/setup.py | 2 +- certbot-dns-google/setup.py | 2 +- certbot-dns-linode/setup.py | 2 +- certbot-dns-luadns/setup.py | 2 +- certbot-dns-nsone/setup.py | 2 +- certbot-dns-ovh/setup.py | 2 +- certbot-dns-rfc2136/setup.py | 2 +- certbot-dns-route53/setup.py | 2 +- certbot-dns-sakuracloud/setup.py | 2 +- certbot-nginx/setup.py | 2 +- certbot/__init__.py | 2 +- letsencrypt-auto-source/letsencrypt-auto | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/acme/setup.py b/acme/setup.py index b5291862b..9fca57e01 100644 --- a/acme/setup.py +++ b/acme/setup.py @@ -3,7 +3,7 @@ from setuptools import find_packages from setuptools.command.test import test as TestCommand import sys -version = '0.35.0' +version = '0.36.0.dev0' # Please update tox.ini when modifying dependency version requirements install_requires = [ diff --git a/certbot-apache/setup.py b/certbot-apache/setup.py index e991a8825..396f1ccf2 100644 --- a/certbot-apache/setup.py +++ b/certbot-apache/setup.py @@ -4,7 +4,7 @@ from setuptools.command.test import test as TestCommand import sys -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-compatibility-test/setup.py b/certbot-compatibility-test/setup.py index dacf43870..362043531 100644 --- a/certbot-compatibility-test/setup.py +++ b/certbot-compatibility-test/setup.py @@ -4,7 +4,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' install_requires = [ 'certbot', diff --git a/certbot-dns-cloudflare/setup.py b/certbot-dns-cloudflare/setup.py index b552b017f..bd201aca2 100644 --- a/certbot-dns-cloudflare/setup.py +++ b/certbot-dns-cloudflare/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-cloudxns/setup.py b/certbot-dns-cloudxns/setup.py index 9156e7a6c..d8d7aa9b8 100644 --- a/certbot-dns-cloudxns/setup.py +++ b/certbot-dns-cloudxns/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-digitalocean/setup.py b/certbot-dns-digitalocean/setup.py index 0c97eadb5..92a9b2b14 100644 --- a/certbot-dns-digitalocean/setup.py +++ b/certbot-dns-digitalocean/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-dnsimple/setup.py b/certbot-dns-dnsimple/setup.py index 91745a27d..709ca8330 100644 --- a/certbot-dns-dnsimple/setup.py +++ b/certbot-dns-dnsimple/setup.py @@ -3,7 +3,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-dnsmadeeasy/setup.py b/certbot-dns-dnsmadeeasy/setup.py index eaf048d33..1d55b0fe4 100644 --- a/certbot-dns-dnsmadeeasy/setup.py +++ b/certbot-dns-dnsmadeeasy/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-gehirn/setup.py b/certbot-dns-gehirn/setup.py index 3c5022832..6dac126d0 100644 --- a/certbot-dns-gehirn/setup.py +++ b/certbot-dns-gehirn/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Please update tox.ini when modifying dependency version requirements install_requires = [ diff --git a/certbot-dns-google/setup.py b/certbot-dns-google/setup.py index 73ba0e795..5c31a81f8 100644 --- a/certbot-dns-google/setup.py +++ b/certbot-dns-google/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-linode/setup.py b/certbot-dns-linode/setup.py index d2e84a8c1..b70a6a39c 100644 --- a/certbot-dns-linode/setup.py +++ b/certbot-dns-linode/setup.py @@ -1,7 +1,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Please update tox.ini when modifying dependency version requirements install_requires = [ diff --git a/certbot-dns-luadns/setup.py b/certbot-dns-luadns/setup.py index 7160c857a..5f5322319 100644 --- a/certbot-dns-luadns/setup.py +++ b/certbot-dns-luadns/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-nsone/setup.py b/certbot-dns-nsone/setup.py index 3e0f6787c..00ed64032 100644 --- a/certbot-dns-nsone/setup.py +++ b/certbot-dns-nsone/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-ovh/setup.py b/certbot-dns-ovh/setup.py index f5cb7782d..bff394bf9 100644 --- a/certbot-dns-ovh/setup.py +++ b/certbot-dns-ovh/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-rfc2136/setup.py b/certbot-dns-rfc2136/setup.py index 0d5cb5498..25c6ae1d1 100644 --- a/certbot-dns-rfc2136/setup.py +++ b/certbot-dns-rfc2136/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-route53/setup.py b/certbot-dns-route53/setup.py index efc5c4d7a..b8af58b30 100644 --- a/certbot-dns-route53/setup.py +++ b/certbot-dns-route53/setup.py @@ -1,7 +1,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot-dns-sakuracloud/setup.py b/certbot-dns-sakuracloud/setup.py index c29a20169..b674b7199 100644 --- a/certbot-dns-sakuracloud/setup.py +++ b/certbot-dns-sakuracloud/setup.py @@ -2,7 +2,7 @@ from setuptools import setup from setuptools import find_packages -version = '0.35.0' +version = '0.36.0.dev0' # Please update tox.ini when modifying dependency version requirements install_requires = [ diff --git a/certbot-nginx/setup.py b/certbot-nginx/setup.py index e7d742b7f..09a1ab8d5 100644 --- a/certbot-nginx/setup.py +++ b/certbot-nginx/setup.py @@ -4,7 +4,7 @@ from setuptools.command.test import test as TestCommand import sys -version = '0.35.0' +version = '0.36.0.dev0' # Remember to update local-oldest-requirements.txt when changing the minimum # acme/certbot version. diff --git a/certbot/__init__.py b/certbot/__init__.py index 0d0c96fb7..32ab75aaa 100644 --- a/certbot/__init__.py +++ b/certbot/__init__.py @@ -1,4 +1,4 @@ """Certbot client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 -__version__ = '0.35.0' +__version__ = '0.36.0.dev0' diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index abe655083..29938c165 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -31,7 +31,7 @@ if [ -z "$VENV_PATH" ]; then fi VENV_BIN="$VENV_PATH/bin" BOOTSTRAP_VERSION_PATH="$VENV_PATH/certbot-auto-bootstrap-version.txt" -LE_AUTO_VERSION="0.35.0" +LE_AUTO_VERSION="0.36.0.dev0" BASENAME=$(basename $0) USAGE="Usage: $BASENAME [OPTIONS] A self-updating wrapper script for the Certbot ACME client. When run, updates From 89d907b1822993623ba9cc18b5fcfe231f6676d5 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 7 Jun 2019 10:57:21 -0700 Subject: [PATCH 3/7] Improve Apache error message when run with insufficient privileges (#7129) * fixes #6369 * Add changelog entry. * Improve error message again. --- CHANGELOG.md | 5 +++-- certbot-apache/certbot_apache/configurator.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad479282..be50f44f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Changed -* +* The error message when Certbot's Apache plugin is unable to modify your + Apache configuration has been improved. ### Fixed @@ -20,7 +21,7 @@ Despite us having broken lockstep, we are continuing to release new versions of all Certbot components during releases for the time being, however, the only package with changes other than its version number was: -* +* certbot-apache More details about these changes can be found on our GitHub repo. diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index 9174143a4..37f8ba289 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -276,7 +276,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): util.lock_dir_until_exit(self.option("server_root")) except (OSError, errors.LockError): logger.debug("Encountered error:", exc_info=True) - raise errors.PluginError("Unable to lock {0}".format(self.option("server_root"))) + raise errors.PluginError( + "Unable to create a lock file in {0}. Are you running" + " Certbot with sufficient privileges to modify your" + " Apache configuration?".format(self.option("server_root"))) self._prepared = True def _verify_exe_availability(self, exe): From 5c663d4d97270dd0f8cd387df7ca5828fbdb4bb8 Mon Sep 17 00:00:00 2001 From: Rob Stradling Date: Fri, 7 Jun 2019 21:03:35 +0100 Subject: [PATCH 4/7] Update the 'manage your account' help to be more generic. (#7127) Resolves #7121. * Update the 'manage your account' help to be more generic. * Add changelog entry about #7127. --- CHANGELOG.md | 1 + certbot/cli.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be50f44f2..50677a94d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Changed +* Update the 'manage your account' help to be more generic. * The error message when Certbot's Apache plugin is unable to modify your Apache configuration has been improved. diff --git a/certbot/cli.py b/certbot/cli.py index b7c021ed4..3334352db 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -96,10 +96,10 @@ manage certificates: revoke Revoke a certificate (supply --cert-path or --cert-name) delete Delete a certificate -manage your account with Let's Encrypt: - register Create a Let's Encrypt ACME account - unregister Deactivate a Let's Encrypt ACME account - update_account Update a Let's Encrypt ACME account +manage your account: + register Create an ACME account + unregister Deactivate an ACME account + update_account Update an ACME account --agree-tos Agree to the ACME server's Subscriber Agreement -m EMAIL Email address for important account notifications """ From 391f742df7310476f521eb910b0ec290f84a7794 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 7 Jun 2019 13:56:38 -0700 Subject: [PATCH 5/7] List Certbot package given #7127. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50677a94d..1e54230cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Despite us having broken lockstep, we are continuing to release new versions of all Certbot components during releases for the time being, however, the only package with changes other than its version number was: +* certbot * certbot-apache More details about these changes can be found on our GitHub repo. From 4d034122c6026a94d837fdaef9bd4df3472056f7 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 7 Jun 2019 14:34:40 -0700 Subject: [PATCH 6/7] Ask for updates, the issue isn't stale. (#7133) This PR attempts to improve the behavior our "stale" bot by asking for updates instead of telling people that their issue is stale. --- .github/stale.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index c248fe9d4..6b317a4b5 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -11,15 +11,15 @@ daysUntilClose: 7 exemptAssignees: true # Label to use when marking as stale -staleLabel: stale +staleLabel: needs-update # Comment to post when marking as stale. Set to `false` to disable markComment: > - To help us better see what issues are still affecting our users, this issue - has been automatically marked as stale. If you still have this issue with an - up-to-date version of Certbot and are interested in seeing it resolved, - please add a comment letting us know. If there is no further activity, this - issue will be automatically closed. + We've made a lot of changes to Certbot since this issue was opened. If you + still have this issue with an up-to-date version of Certbot, can you please + add a comment letting us know? This helps us to better see what issues are + still affecting our users. If there is no further activity, this issue will + be automatically closed. # Comment to post when closing a stale Issue or Pull Request. closeComment: > From 23b52ca1c8798285698b2a051a36b3c98d70191b Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 10 Jun 2019 13:56:57 -0700 Subject: [PATCH 7/7] Fix dns rfc2136 (#7142) * Revert "Add an option to dns_rfc2136 plugin to specify an authorative base domain. (#7029)" This reverts commit 5ab6a597b0e23b604e4d6e339a9d3784abc57217. * Update changelog. --- CHANGELOG.md | 6 ++- .../certbot_dns_rfc2136/__init__.py | 6 +-- .../certbot_dns_rfc2136/dns_rfc2136.py | 50 ++++++------------- .../certbot_dns_rfc2136/dns_rfc2136_test.py | 29 +---------- 4 files changed, 25 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e54230cc..6c2370397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,10 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Fixed -* +* Support for specifying an authoritative base domain in our dns-rfc2136 plugin + has been removed. This feature was added in our last release but had a bug + which caused the plugin to fail so the feature has been removed until it can + be added properly. Despite us having broken lockstep, we are continuing to release new versions of all Certbot components during releases for the time being, however, the only @@ -24,6 +27,7 @@ package with changes other than its version number was: * certbot * certbot-apache +* certbot-dns-rfc2136 More details about these changes can be found on our GitHub repo. diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py index cebff2841..12b360959 100644 --- a/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py +++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/__init__.py @@ -21,8 +21,8 @@ Credentials ----------- Use of this plugin requires a configuration file containing the target DNS -server, optional authorative domain and optional port that supports RFC 2136 Dynamic Updates, -the name of the TSIG key, the TSIG key secret itself and the algorithm used if it's +server and optional port that supports RFC 2136 Dynamic Updates, the name +of the TSIG key, the TSIG key secret itself and the algorithm used if it's different to HMAC-MD5. .. code-block:: ini @@ -33,8 +33,6 @@ different to HMAC-MD5. dns_rfc2136_server = 192.0.2.1 # Target DNS port dns_rfc2136_port = 53 - # Authorative domain (optional, will try to auto-detect if missing) - dns_rfc2136_base_domain = example.com # TSIG key name dns_rfc2136_name = keyname. # TSIG key secret diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136.py index 5db8c3020..2061374e0 100644 --- a/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136.py +++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136.py @@ -79,33 +79,25 @@ class Authenticator(dns_common.DNSAuthenticator): self._get_rfc2136_client().del_txt_record(validation_name, validation) def _get_rfc2136_client(self): - key = _RFC2136Key(self.credentials.conf('name'), - self.credentials.conf('secret'), - self.ALGORITHMS.get(self.credentials.conf('algorithm'), - dns.tsig.HMAC_MD5)) return _RFC2136Client(self.credentials.conf('server'), int(self.credentials.conf('port') or self.PORT), - key, - self.credentials.conf('base-domain')) + self.credentials.conf('name'), + self.credentials.conf('secret'), + self.ALGORITHMS.get(self.credentials.conf('algorithm'), + dns.tsig.HMAC_MD5)) -class _RFC2136Key(object): - def __init__(self, name, secret, algorithm): - self.name = name - self.secret = secret - self.algorithm = algorithm class _RFC2136Client(object): """ Encapsulates all communication with the target DNS server. """ - def __init__(self, server, port, base_domain, key): + def __init__(self, server, port, key_name, key_secret, key_algorithm): self.server = server self.port = port self.keyring = dns.tsigkeyring.from_text({ - key.name: key.secret + key_name: key_secret }) - self.algorithm = key.algorithm - self.base_domain = base_domain + self.algorithm = key_algorithm def add_txt_record(self, record_name, record_content, record_ttl): """ @@ -179,33 +171,23 @@ class _RFC2136Client(object): def _find_domain(self, record_name): """ - If 'base_domain' option is specified check if the requested domain matches this base domain - and return it. If not explicitly specified find the closest domain with an SOA record for - the given domain name. + Find the closest domain with an SOA record for a given domain name. - :param str record_name: The record name for which to find the base domain. + :param str record_name: The record name for which to find the closest SOA record. :returns: The domain, if found. :rtype: str :raises certbot.errors.PluginError: if no SOA record can be found. """ - if self.base_domain: - if not record_name.endswith(self.base_domain): - raise errors.PluginError('Requested domain {0} does not match specified base ' - 'domain {1}.' - .format(record_name, self.base_domain)) - else: - return self.base_domain - else: - domain_name_guesses = dns_common.base_domain_name_guesses(record_name) + domain_name_guesses = dns_common.base_domain_name_guesses(record_name) - # Loop through until we find an authoritative SOA record - for guess in domain_name_guesses: - if self._query_soa(guess): - return guess + # Loop through until we find an authoritative SOA record + for guess in domain_name_guesses: + if self._query_soa(guess): + return guess - raise errors.PluginError('Unable to determine base domain for {0} using names: {1}.' - .format(record_name, domain_name_guesses)) + raise errors.PluginError('Unable to determine base domain for {0} using names: {1}.' + .format(record_name, domain_name_guesses)) def _query_soa(self, domain_name): """ diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136_test.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136_test.py index bed3445b6..d800f1ec7 100644 --- a/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136_test.py +++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/dns_rfc2136_test.py @@ -73,12 +73,9 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic class RFC2136ClientTest(unittest.TestCase): def setUp(self): - from certbot_dns_rfc2136.dns_rfc2136 import _RFC2136Client, _RFC2136Key + from certbot_dns_rfc2136.dns_rfc2136 import _RFC2136Client - self.rfc2136_client = _RFC2136Client(SERVER, - PORT, - None, - _RFC2136Key(NAME, SECRET, dns.tsig.HMAC_MD5)) + self.rfc2136_client = _RFC2136Client(SERVER, PORT, NAME, SECRET, dns.tsig.HMAC_MD5) @mock.patch("dns.query.tcp") def test_add_txt_record(self, query_mock): @@ -165,28 +162,6 @@ class RFC2136ClientTest(unittest.TestCase): self.rfc2136_client._find_domain, 'foo.bar.'+DOMAIN) - def test_find_domain_with_base(self): - # _query_soa | pylint: disable=protected-access - self.rfc2136_client._query_soa = mock.MagicMock(side_effect=[False, False, True]) - self.rfc2136_client.base_domain = 'bar.' + DOMAIN - - # _find_domain | pylint: disable=protected-access - domain = self.rfc2136_client._find_domain('foo.bar.' + DOMAIN) - - self.assertTrue(domain == 'bar.' + DOMAIN) - - def test_find_domain_with_wrong_base(self): - - # _query_soa | pylint: disable=protected-access - self.rfc2136_client._query_soa = mock.MagicMock(side_effect=[False, False, True]) - self.rfc2136_client.base_domain = 'wrong.' + DOMAIN - - self.assertRaises( - errors.PluginError, - # _find_domain | pylint: disable=protected-access - self.rfc2136_client._find_domain, - 'foo.bar.' + DOMAIN) - @mock.patch("dns.query.udp") def test_query_soa_found(self, query_mock): query_mock.return_value = mock.MagicMock(answer=[mock.MagicMock()], flags=dns.flags.AA)