Skip to content
Snippets Groups Projects
Commit 2cb05a3f authored by Lukáš Doktor's avatar Lukáš Doktor Committed by Eduardo Habkost
Browse files

qmp.py: Avoid "has_key" usage


The "has_key" is deprecated in favor of "__in__" operator.

Signed-off-by: default avatarLukáš Doktor <ldoktor@redhat.com>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170818142613.32394-9-ldoktor@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 3dd29b41
No related branches found
No related tags found
No related merge requests found
......@@ -197,7 +197,7 @@ def command(self, cmd, **kwds):
Build and send a QMP command to the monitor, report errors if any
"""
ret = self.cmd(cmd, kwds)
if ret.has_key('error'):
if "error" in ret:
raise Exception(ret['error']['desc'])
return ret['return']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment