From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ykjzx-0005Wm-Pu for qemu-devel@nongnu.org; Tue, 21 Apr 2015 22:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ykjzw-0005LV-5K for qemu-devel@nongnu.org; Tue, 21 Apr 2015 22:02:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ykjzv-0005LD-Ue for qemu-devel@nongnu.org; Tue, 21 Apr 2015 22:02:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3M22hpO026580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 21 Apr 2015 22:02:43 -0400 From: John Snow Date: Tue, 21 Apr 2015 22:02:33 -0400 Message-Id: <1429668155-1606-4-git-send-email-jsnow@redhat.com> In-Reply-To: <1429668155-1606-1-git-send-email-jsnow@redhat.com> References: <1429668155-1606-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] scripts: qmp-shell: allow single-quotes in JSON expressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lcapitulino@redhat.com, John Snow , kchamart@redhat.com As a convenience for the user, replace any single quotes given with double quotes so that the data will deserialize correctly via json.loads(). Signed-off-by: John Snow --- scripts/qmp/qmp-shell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 5347f89..d7cb33d 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -129,7 +129,7 @@ class QMPShell(qmp.QEMUMonitorProtocol): < command-name > [ arg-name1=arg1 ] ... [ arg-nameN=argN ] """ - cmdargs = cmdline.split() + cmdargs = cmdline.replace("'", '"').split() qmpcmd = { 'execute': cmdargs[0], 'arguments': {} } self.__cli_expr(cmdargs[1:], qmpcmd['arguments']) return qmpcmd -- 2.1.0