How to use the certbot-dns-google.certbot_dns_google.dns_google._GoogleClient.get_project_id function in certbot-dns-google

To help you get started, we’ve selected a few certbot-dns-google examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github certbot / certbot / certbot-dns-google / certbot_dns_google / dns_google.py View on Github external
def _setup_credentials(self):
        if self.conf('credentials') is None:
            try:
                # use project_id query to check for availability of google metadata server
                # we won't use the result but know we're not on GCP when an exception is thrown
                _GoogleClient.get_project_id()
            except (ValueError, httplib2.ServerNotFoundError):
                raise errors.PluginError('Unable to get Google Cloud Metadata and no credentials'
                                         ' specified. Automatic credential lookup is only '
                                         'available on Google Cloud Platform. Please configure'
                                         ' credentials using --dns-google-credentials ')
        else:
            self._configure_file('credentials',
                                 'path to Google Cloud DNS service account JSON file')

            dns_common.validate_file_permissions(self.conf('credentials'))

certbot-dns-google

Google Cloud DNS Authenticator plugin for Certbot

Apache-2.0
Latest version published 3 days ago

Package Health Score

90 / 100
Full package analysis

Similar packages