From nobody Thu Apr 25 22:39:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568125340; cv=none; d=zoho.com; s=zohoarc; b=DoUGGxARe9W0hpx9ck0MVmERrUkiz3gBud75rmKDZfqv/FyBhmRLqPFUxrCMm2obdqnBu9qKVsXOQMDtop7kQJqIOZ5GRoJu/m9pMn2PCAqb/A8g6Ya2JzJ53sLUaP0jEPVvB8UKfrJ9lQtD9n3Xz0FOomJNVtKxSbiJCB0fHzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568125340; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=F9j/fC1s3IVAz/V8B3JWjM1eChQpvlW1L3l+3sxeguI=; b=QeQNTcrRnHhrv3/Tgc+om/Ot/GNEcEOwMqjNP2HskkDPmkhpDwJ9loZCypNMp73glI553iqX6ODwNURhjXV7CYfViqZuhNTSpFaIXAv0+yQPO+HeuDsPlWch6zjDtKamQE6KwBc06TIfPr9iz0fl4Ne0ZeXbQZ8zNeHZyd55stw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of 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.zohomail.com with SMTPS id 156812534030116.85576064037116; Tue, 10 Sep 2019 07:22:20 -0700 (PDT) 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) 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) 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) 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-Google-Smtp-Source: APXvYqwHrUOuwZDIT/2WsmIpycWEJQ23ciMMv4wQLQfzM0lrPXnIimatULlkEXBWA7k3qxjXITcI3w== X-Received: by 2002:a63:fe52:: with SMTP id x18mr9311906pgj.344.1568096396491; Mon, 09 Sep 2019 23:19:56 -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: , Content-Transfer-Encoding: quoted-printable 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) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: ossdev libvirt-python:fix bug of sanitytest.py script Signed-off-by: ossdev --- sanitytest.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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] =20 +def sanitize_enum_val(value): + if value =3D=3D 'VIR_TYPED_PARAM_INT': + value =3D 1 + elif value =3D=3D 'VIR_TYPED_PARAM_UINT': + value =3D 2 + elif value =3D=3D 'VIR_TYPED_PARAM_LLONG': + value =3D 3 + elif value =3D=3D 'VIR_TYPED_PARAM_ULLONG': + value =3D 4 + elif value =3D=3D 'VIR_TYPED_PARAM_DOUBLE': + value =3D 5 + elif value =3D=3D 'VIR_TYPED_PARAM_BOOLEAN': + value =3D 6 + return value + # Path to the libvirt API XML file if len(sys.argv) >=3D 3: xml =3D sys.argv[2] @@ -48,8 +63,8 @@ set =3D tree.xpath('/api/symbols/enum') for n in set: typ =3D n.attrib['type'] name =3D n.attrib['name'] - val =3D n.attrib['value'] - + #val =3D n.attrib['value'] + val =3D sanitize_enum_val(n.attrib['value']) if typ not in enumvals: enumvals[typ] =3D {} =20 --=20 2.17.1 --=20 *Disclaimer* -The information transmitted is intended solely for the=20 individual or entity to which it is addressed and may contain confidential=20 and/or privileged material. Any review, re-transmission, dissemination or=20 other use of or taking action in reliance upon this information by persons=20 or entities other than the intended recipient is prohibited. If you have=20 received this email in error please contact the sender and delete the=20 material from any computer. In such instances you are further prohibited=20 from reproducing, disclosing, distributing or taking any action in reliance=20 on it.As a recipient of this email, you are responsible for screening its=20 contents and the contents of any attachments for the presence of viruses.=20 No liability is accepted for any damages caused by any virus transmitted by=20 this email. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list