diff options
author | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2018-04-26 01:09:50 +0300 |
---|---|---|
committer | sydneyli <sydli@stanford.edu> | 2018-04-26 01:09:50 +0300 |
commit | bf30226c697402adac656bfd7956395fc104714b (patch) | |
tree | d6036fc2abc41eec8bbc2d1921025534b7dbb91d | |
parent | f510f4bddf4da1411c1966a9cbed2b7e630cba30 (diff) |
Restore parallel waiting to Route53 plugin (#5712)
* Bring back parallel updates to route53.
* Re-add try
* Fix TTL.
* Remove unnecessary wait.
* Add pylint exceptions.
* Add dummy perform.
* review.feedback
* Fix underscore.
* Fix lint.
-rw-r--r-- | certbot-dns-route53/certbot_dns_route53/dns_route53.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/certbot-dns-route53/certbot_dns_route53/dns_route53.py b/certbot-dns-route53/certbot_dns_route53/dns_route53.py index 08b1d03f0..27d185656 100644 --- a/certbot-dns-route53/certbot_dns_route53/dns_route53.py +++ b/certbot-dns-route53/certbot_dns_route53/dns_route53.py @@ -42,14 +42,26 @@ class Authenticator(dns_common.DNSAuthenticator): def _setup_credentials(self): pass - def _perform(self, domain, validation_domain_name, validation): - try: - change_id = self._change_txt_record("UPSERT", validation_domain_name, validation) + def _perform(self, domain, validation_domain_name, validation): # pylint: disable=missing-docstring + pass - self._wait_for_change(change_id) + def perform(self, achalls): + self._attempt_cleanup = True + + try: + change_ids = [ + self._change_txt_record("UPSERT", + achall.validation_domain_name(achall.domain), + achall.validation(achall.account_key)) + for achall in achalls + ] + + for change_id in change_ids: + self._wait_for_change(change_id) except (NoCredentialsError, ClientError) as e: logger.debug('Encountered error during perform: %s', e, exc_info=True) raise errors.PluginError("\n".join([str(e), INSTRUCTIONS])) + return [achall.response(achall.account_key) for achall in achalls] def _cleanup(self, domain, validation_domain_name, validation): try: |