VNX: raise exception if no storops

Previously, if storops is not installed, driver will raise
AttributeError: 'NoneType' object has no attribute 'VNXSystem'.
Now, driver will report clear message in order not to confuse user.

Closes-Bug: 1629223
Change-Id: I1fbdd73063f3d06329f94184701014b247fb889e
This commit is contained in:
Peter Wang 2016-09-30 05:37:58 -04:00
parent ed909a8ed3
commit a87d978a46

View File

@ -81,6 +81,9 @@ class Client(object):
def __init__(self, ip, username, password, scope,
naviseccli, sec_file):
self.naviseccli = naviseccli
if not storops:
msg = _('storops Python library is not installed.')
raise exception.VolumeBackendAPIException(message=msg)
self.vnx = storops.VNXSystem(ip=ip,
username=username,
password=password,