mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 09:54:02 -07:00
parent
2f33c1a1a1
commit
5553b20828
206 changed files with 1853 additions and 1870 deletions
|
@ -25,10 +25,6 @@
|
|||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
# 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.compute.types import Provider
|
||||
|
@ -37,9 +33,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-gce"
|
||||
USER_AGENT_VERSION = "v1"
|
||||
|
||||
|
||||
def gce_connect(module, provider=None):
|
||||
"""Return a GCP connection for Google Compute Engine."""
|
||||
if not HAS_LIBCLOUD_BASE:
|
||||
|
@ -48,6 +48,7 @@ def gce_connect(module, provider=None):
|
|||
|
||||
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