2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

Better error message on unsupported media

The URI scheme is given a more appropriate and specific
error.

Change-Id: Ifc9690ba24e3ddfda1799eb2da68f1f76a1b8e92
This commit is contained in:
Jarrod Johnson 2018-02-23 17:02:11 -05:00
parent 05b973dff0
commit 706715bc7d

View File

@ -867,7 +867,9 @@ class XCCClient(IMMClient):
rq['Protocol'] = 7
rq['Url'] = url
else:
raise Exception('TODO')
raise pygexc.UnsupportedFunctionality(
'{0} scheme is not supported on this system or '
'invalid url format')
rt = self.wc.grab_json_response('/api/providers/rp_vm_remote_connect',
json.dumps(rq))
if 'return' not in rt or rt['return'] != 0: