Merge "Fix error message when running genconfig"

This commit is contained in:
Jenkins 2016-03-18 21:38:29 +00:00 committed by Gerrit Code Review
commit 1a31fd55d4

View File

@ -39,10 +39,9 @@ CONF = cfg.CONF
try: try:
import pywbem import pywbem
pywbemAvailable = True
except ImportError: except ImportError:
msg = _LE('import pywbem failed!! ' pywbemAvailable = False
'pywbem is necessary for this volume driver.')
LOG.error(msg)
VOL_PREFIX = "FJosv_" VOL_PREFIX = "FJosv_"
RAIDGROUP = 2 RAIDGROUP = 2
@ -154,6 +153,11 @@ class FJDXCommon(object):
} }
def __init__(self, prtcl, configuration=None): def __init__(self, prtcl, configuration=None):
if not pywbemAvailable:
LOG.error(_LE('import pywbem failed!! '
'pywbem is necessary for this volume driver.'))
self.protocol = prtcl self.protocol = prtcl
self.configuration = configuration self.configuration = configuration
self.configuration.append_config_values(FJ_ETERNUS_DX_OPT_opts) self.configuration.append_config_values(FJ_ETERNUS_DX_OPT_opts)