diff --git a/delfin/drivers/hpe/hpe_3par/rest_handler.py b/delfin/drivers/hpe/hpe_3par/rest_handler.py index 2880b2099..8f4e0f1c3 100644 --- a/delfin/drivers/hpe/hpe_3par/rest_handler.py +++ b/delfin/drivers/hpe/hpe_3par/rest_handler.py @@ -158,6 +158,8 @@ def login(self): {"url": url, "reason": res.text}) if 'invalid username or password' in res.text: raise exception.InvalidUsernameOrPassword() + elif 'maximum number of server connections' in res.text: + raise exception.StorageMaxUserCountException(res.text) else: raise exception.StorageBackendException( six.text_type(res.text)) @@ -165,9 +167,13 @@ def login(self): LOG.error('Login Parameter error') return access_session + except exception.DelfinException as e: + err_msg = "Login error: %s" % (e.msg) + LOG.error(err_msg) + raise e except Exception as e: LOG.error("Login error: %s", six.text_type(e)) - raise e + raise exception.StorageBackendException(six.text_type(e)) finally: self.session_lock.release() diff --git a/delfin/drivers/hpe/hpe_3par/ssh_handler.py b/delfin/drivers/hpe/hpe_3par/ssh_handler.py index e650370c5..8bd2aecfe 100644 --- a/delfin/drivers/hpe/hpe_3par/ssh_handler.py +++ b/delfin/drivers/hpe/hpe_3par/ssh_handler.py @@ -485,7 +485,7 @@ def exec_command(self, command): raise NotImplementedError(re) elif 'Too many local CLI connections' in re: LOG.error("command %s failed: %s" % (command, re)) - raise exception.StorageBackendException(re) + raise exception.StorageMaxUserCountException(re) return re def get_volumes(self): diff --git a/delfin/drivers/utils/rest_client.py b/delfin/drivers/utils/rest_client.py index e72868eb6..f0663dee9 100644 --- a/delfin/drivers/utils/rest_client.py +++ b/delfin/drivers/utils/rest_client.py @@ -109,7 +109,11 @@ def do_call(self, url, data, method, raise exception.InvalidIpOrPort() elif 'Read timed out' in str(err): raise exception.StorageBackendException(six.text_type(err)) + elif 'ConnectionResetError(10054' in str(err): + raise exception.StorageMaxUserCountException(str(err)) + elif 'maximum number of server connections' in str(err): + raise exception.StorageMaxUserCountException(str(err)) else: - raise exception.BadResponse() + raise exception.StorageBackendException(str(err)) return res