return actual error from module logic on gcp_compute (#55055)

* return actual error from module logic on gcp_compute

* changing how the error is presented

* sanity
This commit is contained in:
Alex Stephen 2019-04-09 15:35:05 -07:00 committed by ansibot
parent ebd4462c23
commit 5215d00462

View file

@ -124,6 +124,12 @@ from ansible.module_utils._text import to_native
from ansible.module_utils.gcp_utils import GcpSession, navigate_hash, GcpRequestException from ansible.module_utils.gcp_utils import GcpSession, navigate_hash, GcpRequestException
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
try:
import google.auth
import requests
except ImportError:
raise AnsibleError('The gcp dynamic inventory plugin requires the requests and google-auth libraries')
# Mocking a module to reuse module_utils # Mocking a module to reuse module_utils
class GcpMockModule(object): class GcpMockModule(object):