mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-07 08:49:11 -07:00
parent
2f33c1a1a1
commit
5553b20828
206 changed files with 1853 additions and 1870 deletions
|
@ -27,9 +27,6 @@
|
|||
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
from ansible.module_utils.gcp import gcp_connect
|
||||
from ansible.module_utils.gcp import unexpected_error_msg as gcp_error
|
||||
|
||||
try:
|
||||
from libcloud.dns.types import Provider
|
||||
from libcloud.dns.providers import get_driver
|
||||
|
@ -37,9 +34,13 @@ try:
|
|||
except ImportError:
|
||||
HAS_LIBCLOUD_BASE = False
|
||||
|
||||
from ansible.module_utils.gcp import gcp_connect
|
||||
from ansible.module_utils.gcp import unexpected_error_msg as gcp_error
|
||||
|
||||
USER_AGENT_PRODUCT = "Ansible-gcdns"
|
||||
USER_AGENT_VERSION = "v1"
|
||||
|
||||
|
||||
def gcdns_connect(module, provider=None):
|
||||
"""Return a GCP connection for Google Cloud DNS."""
|
||||
if not HAS_LIBCLOUD_BASE:
|
||||
|
@ -48,6 +49,7 @@ def gcdns_connect(module, provider=None):
|
|||
provider = provider or Provider.GOOGLE
|
||||
return gcp_connect(module, provider, get_driver, USER_AGENT_PRODUCT, USER_AGENT_VERSION)
|
||||
|
||||
|
||||
def unexpected_error_msg(error):
|
||||
"""Create an error string based on passed in error."""
|
||||
return gcp_error(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue