Merge "Don't fall when just loading octaviav2 modules"
diff --git a/_modules/octaviav2/common.py b/_modules/octaviav2/common.py
index 7cccf0b..ddc8138 100644
--- a/_modules/octaviav2/common.py
+++ b/_modules/octaviav2/common.py
@@ -1,7 +1,13 @@
import logging
-import os_client_config
from uuid import UUID
+try:
+ import os_client_config
+except ImportError:
+ os_client_config = None
+from salt import exceptions
+
+
log = logging.getLogger(__name__)
@@ -39,6 +45,10 @@
def _get_raw_client(cloud_name):
+ if not os_client_config:
+ raise exceptions.SaltInvocationError(
+ "Cannot load os-client-config. Please check your environment "
+ "configuration.")
service_type = 'load-balancer'
config = os_client_config.OpenStackConfig()
cloud = config.get_one_cloud(cloud_name)