Don't fall when just loading cinderv3 modules
this avoids loading warnings on salt-master that may not have
os-client-config installed, as salt tries to load them irrespective of
__virtual__() result.
Change-Id: I6b2e86d3bc64766ef86d8d0223a798467ef80e15
Related-Issue: https://mirantis.jira.com/browse/PROD-26920
diff --git a/_modules/cinderv3/common.py b/_modules/cinderv3/common.py
index df419e9..e039f87 100644
--- a/_modules/cinderv3/common.py
+++ b/_modules/cinderv3/common.py
@@ -1,6 +1,11 @@
import time
import logging
-import os_client_config
+
+try:
+ import os_client_config
+except ImportError:
+ os_client_config = None
+from salt import exceptions
log = logging.getLogger(__name__)
@@ -43,6 +48,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 = 'volumev3'
config = os_client_config.OpenStackConfig()
cloud = config.get_one_cloud(cloud_name)