mirror of
https://opendev.org/x/pyghmi
synced 2025-08-22 02:50:23 +00:00
Provide better error message for common scenarios
There are a few error codes that pretty much mean the same thing. Provide a better text message to match that error code. Change-Id: Ic673b8dff3f11296ddd99631600c7b45eb8dab76
This commit is contained in:
@@ -795,10 +795,16 @@ class XCCClient(IMMClient):
|
||||
rt = self.wc.grab_json_response('/api/providers/rp_vm_remote_connect',
|
||||
json.dumps(rq))
|
||||
if 'return' not in rt or rt['return'] != 0:
|
||||
if rt['return'] in (657, 659, 656):
|
||||
raise pygexc.InvalidParameterValue(
|
||||
'Given location was unreachable by the XCC')
|
||||
raise Exception('Unhandled return: ' + repr(rt))
|
||||
rt = self.wc.grab_json_response('/api/providers/rp_vm_remote_mountall',
|
||||
'{}')
|
||||
if 'return' not in rt or rt['return'] != 0:
|
||||
if rt['return'] in (657, 659, 656):
|
||||
raise pygexc.InvalidParameterValue(
|
||||
'Given location was unreachable by the XCC')
|
||||
raise Exception('Unhandled return: ' + repr(rt))
|
||||
if not self.webkeepalive:
|
||||
self._keepalivesession = self._wc
|
||||
|
Reference in New Issue
Block a user