From 798b4bdf1ba4aeabe85f2c3d50f5e381b44baebe Mon Sep 17 00:00:00 2001 From: Jon Chen Date: Sun, 25 May 2014 14:55:49 -0400 Subject: [PATCH] require pycurl for linode module --- cloud/linode | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cloud/linode b/cloud/linode index 830fb18acff..9fd265fde05 100644 --- a/cloud/linode +++ b/cloud/linode @@ -88,7 +88,7 @@ options: description: - how long before wait gives up, in seconds default: 300 -requirements: [ "linode-python" ] +requirements: [ "linode-python", "pycurl" ] author: Vincent Viallet notes: - LINODE_API_KEY env variable can be used instead @@ -156,14 +156,19 @@ import time import os try: - # linode module raise warning due to ssl - silently ignore them ... - import warnings - warnings.simplefilter("ignore") + import pycurl +except ImportError: + print("failed=True msg='pycurl required for this module'") + sys.exit(1) + + +try: from linode import api as linode_api except ImportError: print("failed=True msg='linode-python required for this module'") sys.exit(1) + def randompass(): ''' Generate a long random password that comply to Linode requirements