mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Make sure the util can import novaclient
This commit is contained in:
parent
131cf5dca9
commit
b57c21ca0a
3 changed files with 5 additions and 11 deletions
|
@ -1,3 +1,4 @@
|
|||
mysql-python
|
||||
timelib
|
||||
yappi >= 0.8.2
|
||||
python-novaclient
|
||||
|
|
|
@ -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__ = {}
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue