From patchwork Tue Sep 10 06:19:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oss dev X-Patchwork-Id: 173523 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp5868737ilq; Tue, 10 Sep 2019 07:22:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzo3n04fT5EdKmPArsz9vxCG12vzr+abSg8PQeEQ259Cu92TQI16G2mgUrR62qB1qvS1J2 X-Received: by 2002:ae9:e50f:: with SMTP id w15mr29873117qkf.129.1568125338352; Tue, 10 Sep 2019 07:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568125338; cv=none; d=google.com; s=arc-20160816; b=tt82ZnNgiNrB4hj5cqTeW4n73HBkbcl6Ij2aNsDIfIHG34XPKe7amUwROKaEQkbPTk eZ5hIonT2KULBzRUtjLM9mQMP+w+JP/jNVjKZEArji/uokBb1uh1sdUOrar5EDc+VOhF VA77AOLp6WTG82IMF881U3AdAY0L+G+h1IPdOx5h7G7iz7ucsVCD9ONJmAf/zMp473ed WcbyU2mIATIxY3WVB+i6sJDjW3BfH8oyfzfJ9kLgM50D10R9SRjaLsNztXflKfGB1/uS Fdyj5/Mr7RxwOMwtQYAMnUEEhRIQZpJKo5dKrAnG2zkykAPT9y9U1ALgLexxgBQ6Ewmx UDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:date:to:from:message-id:mime-version:dkim-signature:delivered-to; bh=F9j/fC1s3IVAz/V8B3JWjM1eChQpvlW1L3l+3sxeguI=; b=s+1WR9JvJQ0RFGogj15p/sfNCoyRaiZ8/KlMsvdlytMchdxpg1C4s3CT2Wkf9rKVaX MwaBgU7h5ePxL4EMukfQY1bU9CVvZgVF73sK0/3jqPwJNKIgcb48QYk6lP+zIixZwKcQ 3EB6AJl4ph4masC1y8cxNckdckxQz/Yc2/k4GCn8CP5sn6U+5DATnNZSCUSNoF04FmBQ o0AElcPAyafZ8+UeMG4O5zIns2hisoHOpCUitE1Nx4buW6PkF0aWh23aFrtmY5lEUab2 eaXf259ICbwg+lwTymPl/Lgd7vtrSS7ZJ6uFGcq9fTVj7uGudWWkkuKc9NxVkFPRxXLX 1fNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@puresoftware-com.20150623.gappssmtp.com header.s=20150623 header.b=aJ3VDbtN; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 184si13638472qkd.245.2019.09.10.07.22.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 07:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@puresoftware-com.20150623.gappssmtp.com header.s=20150623 header.b=aJ3VDbtN; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6ED42315C01A; Tue, 10 Sep 2019 14:22:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C73665D6B2; Tue, 10 Sep 2019 14:22:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B6BB86B49E; Tue, 10 Sep 2019 14:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8A6K1Mj018582 for ; Tue, 10 Sep 2019 02:20:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D1456012C; Tue, 10 Sep 2019 06:20:01 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mx1.redhat.com (ext-mx25.extmail.prod.ext.phx2.redhat.com [10.5.110.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 242A26012A for ; Tue, 10 Sep 2019 06:19:58 +0000 (UTC) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B34710C0932 for ; Tue, 10 Sep 2019 06:19:57 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id d15so10891657pfo.10 for ; Mon, 09 Sep 2019 23:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=puresoftware-com.20150623.gappssmtp.com; s=20150623; h=mime-version:message-id:from:to:cc:subject:date; bh=Ng0+f4E1t1nQHf6lkCL2Ix6/NX6tQKsleNY000IDpFg=; b=aJ3VDbtNE24fOJV/OdII17PeWSJN+PfFpAhktL5O+DxLlFtK1OLps1mERE8bR6s37r vFMKUU0rYhtyxQEwiv1EcZ9V3yWlmle1fCoJwI2O//sUg0skUV4hHMNYzEj7sTetfras qMlIR/W9aJJX+Q+jL+NaHAai6QYZmMSfUg+Tox602PjjO5SgCPBsnUPOzD9KiYC7/yy5 nvT4RzCvgyb3SkPsTmV0F7v29DZFebK4Unan+0XShbNPO4HpHi/lInaHRnmtPLH+0fLP 6p1Ucva8sUQSOpr/rVjNmsGtXAm9PdrieBKFEZPBI73bMuY2Ec7M4cUstitu1CCyU8Ph 9lWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=mime-version:x-gm-message-state:message-id:from:to:cc:subject:date; bh=Ng0+f4E1t1nQHf6lkCL2Ix6/NX6tQKsleNY000IDpFg=; b=ZYxxnXPAVUf9lhYwJX9CzZBt3or/gShWbhlikVO1MZ1FOylw4ZpPDTO1+KnclC0AQr 5jZWbaoH5hWdL2Skzw0Mw/B7BfK3F0fbIbVraxpJmdwLlKkRKvF88fwzHbZmr+traESc eAi+DaLoL9ulPE3hzrl0W/pGvPx0VHbq0yXHsLd5e3M8BJs5Kj57SFMeqA2H3oSOS0bf Ti4mfbRPSmQLpRQj506xEzBjybAnp9W9JVi8HfIi85Av43YZIknrhba9+Zkg01A0Euva 41preMIBt03TDfch0sezHziwxq2S833826LQQlqQ6r2n0CqhvvIQjY9yTtMnoKJQNzAl hoIg== MIME-Version: 1.0 X-Gm-Message-State: APjAAAUtNR12Lh0xlfcfa8stlt4ryfZrv5QmhPqHceSNt1yTcB8+WnU8 52TNytJ7nI1t4DDp0hJLIVcWAkkvRiL67LyKR/rKdN+RFDnV/7nUaytMHA+2AUCs55DEAEHPctn I1MkKoOAtEQJLSeA= X-Received: by 2002:a63:fe52:: with SMTP id x18mr9311906pgj.344.1568096396491; Mon, 09 Sep 2019 23:19:56 -0700 (PDT) Received: from x_server_embedded.puresoft.int ([125.63.92.170]) by smtp.gmail.com with ESMTPSA id v20sm13284658pfe.156.2019.09.09.23.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2019 23:19:55 -0700 (PDT) Message-ID: <5d77408b.1c69fb81.b2c75.53b0@mx.google.com> X-Google-Original-Message-ID: <20190910061937.5816-1-ossdev> From: ossdev@puresoftware.com X-Google-Original-From: ossdev To: libvir-list@redhat.com Date: Tue, 10 Sep 2019 06:19:37 +0000 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 10 Sep 2019 06:19:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 10 Sep 2019 06:19:57 +0000 (UTC) for IP:'209.85.210.174' DOMAIN:'mail-pf1-f174.google.com' HELO:'mail-pf1-f174.google.com' FROM:'ossdev@puresoftware.com' RCPT:'' X-RedHat-Spam-Score: 0.002 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.210.174 mail-pf1-f174.google.com 209.85.210.174 mail-pf1-f174.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.66 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 10 Sep 2019 10:21:10 -0400 Cc: ossdev Subject: [libvirt] [PATCH] libvirt_python:fix bug of sanitytest.py script X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 10 Sep 2019 14:22:17 +0000 (UTC) From: ossdev libvirt-python:fix bug of sanitytest.py script Signed-off-by: ossdev --- sanitytest.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.17.1 -- *Disclaimer* -The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. In such instances you are further prohibited from reproducing, disclosing, distributing or taking any action in reliance on it.As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/sanitytest.py b/sanitytest.py index e87b57d..c5d1f42 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -22,6 +22,21 @@ def get_libvirt_api_xml_path(): sys.exit(proc.returncode) return stdout.splitlines()[0] +def sanitize_enum_val(value): + if value == 'VIR_TYPED_PARAM_INT': + value = 1 + elif value == 'VIR_TYPED_PARAM_UINT': + value = 2 + elif value == 'VIR_TYPED_PARAM_LLONG': + value = 3 + elif value == 'VIR_TYPED_PARAM_ULLONG': + value = 4 + elif value == 'VIR_TYPED_PARAM_DOUBLE': + value = 5 + elif value == 'VIR_TYPED_PARAM_BOOLEAN': + value = 6 + return value + # Path to the libvirt API XML file if len(sys.argv) >= 3: xml = sys.argv[2] @@ -48,8 +63,8 @@ set = tree.xpath('/api/symbols/enum') for n in set: typ = n.attrib['type'] name = n.attrib['name'] - val = n.attrib['value'] - + #val = n.attrib['value'] + val = sanitize_enum_val(n.attrib['value']) if typ not in enumvals: enumvals[typ] = {}