Make sure the util can import novaclient

This commit is contained in:
Daniel Wallace 2014-03-03 18:24:00 -06:00
parent 131cf5dca9
commit b57c21ca0a
3 changed files with 5 additions and 11 deletions

View file

@ -1,3 +1,4 @@
mysql-python
timelib
yappi >= 0.8.2
python-novaclient

View file

@ -37,14 +37,6 @@ Module for handling OpenStack Nova calls
salt '*' nova.flavor_list profile=openstack1
'''
# Import third party libs
HAS_NOVA = False
try:
from novaclient.v1_1 import client
HAS_NOVA = True
except ImportError:
pass
# Import python libs
import time
import logging
@ -68,9 +60,7 @@ def __virtual__():
Only load this module if nova
is installed on this minion.
'''
if HAS_NOVA:
return 'nova'
return False
return suon.check_nova()
__opts__ = {}

View file

@ -20,6 +20,9 @@ import salt.utils
# Get logging started
log = logging.getLogger(__name__)
def check_nova():
return HAS_NOVA
# Function alias to not shadow built-ins
class SaltNova(object):