From nobody Sat Jul 5 15:52:46 2025 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; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521296682618683.014045072962; Sat, 17 Mar 2018 07:24:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D478A80467; Sat, 17 Mar 2018 14:24:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1CBB7BCB4; Sat, 17 Mar 2018 14:24:40 +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 57C56181B9FF; Sat, 17 Mar 2018 14:24:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2HENtrr000519 for ; Sat, 17 Mar 2018 10:23:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id A37FF77D48; Sat, 17 Mar 2018 14:23:55 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D4C880E98 for ; Sat, 17 Mar 2018 14:23:55 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) (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 5FBD28553D for ; Sat, 17 Mar 2018 14:23:54 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id u46so283821wrc.11 for ; Sat, 17 Mar 2018 07:23:54 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id i66sm11060550wmd.0.2018.03.17.07.23.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Mar 2018 07:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gMbc5tBhhYsZnHTjwHNYZrrYvYoc2Wgp+pPsdg9d+JU=; b=Z83hTWvzwruqJZAKs7ZxWF8lhrKd0zBtiX5tfVZCuD8jtev/63M5FX/SnwtmOV/2cC qpUTqqiFzz8woEJ4QonFLYu8XIiyP68VybyE7HDTWZmZ9uPBu2J4VBLOL2DGR7oi1Jwq Wuu3PYMlba18s2NQBHZJZjgUYoZY818hG280RamHZUncnBWH19BQ8naVXsmtGqnF2EQj OuDgf62Cxti43m4a2qnGSl8avPD0rTwRkUNZUJJWslDcjozCA7f2pSsh3FE2QrGgKg9v GJiy0uI81v3KUZBCYir5az/BtIA/OWYxQJCQb6iFLlGHyNr33lFDTWq3cg8eRAxGBG8V +5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gMbc5tBhhYsZnHTjwHNYZrrYvYoc2Wgp+pPsdg9d+JU=; b=Fhi9tc0DKiaTUzqeCFzuHb33yN1q1C7qH9oYHSEyQ0r0n+XQB+N4VV9ECNPL0la5uc 7W9aE6ueqQL2OVION6BFTnvDvH8RMu2UeJWYe+uqDqA6K779DBQo1XqBVBTf8R6G+eVb Q9BJZcvPLN8U1zMkhdKajlEdW9mpWFGW/LFQdAe/ysOjTveyczxsW0J7cah2a3IpVV3i jQibkZ1KZ7OI2wPkkAfKSpI9Xotxt3tMEiBnvpvO2B/ZQyYMdkgXBUhoPNydBUZ+BhhN X7ZaMyarncf962DbtFHw4BP+q2+vgHpoh1ZcODnU38LzxFvX87sqOf0W+hw+QD6P6hHH lPKg== X-Gm-Message-State: AElRT7H4kZ5RCYmYKQlmyTqXa5W7Bwl2Y4jVkASnpubPo9CQQPXOHKU6 Tzu8Sr6HMna6lCSI1jlPP4ivpWyb X-Google-Smtp-Source: AG47ELu5LzSBV4HJvV6eYdcz1ijmhw+49UdT9l7LH+zTsOJvMvmxIna2NQ7D0RKA/ZV9LjqJepo/xg== X-Received: by 10.223.208.202 with SMTP id z10mr1856664wrh.15.1521296632808; Sat, 17 Mar 2018 07:23:52 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Sat, 17 Mar 2018 14:23:24 +0000 Message-Id: <20180317142340.11653-7-rstoyanov1@gmail.com> In-Reply-To: <20180317142340.11653-1-rstoyanov1@gmail.com> References: <20180317142340.11653-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 17 Mar 2018 14:23:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 17 Mar 2018 14:23:54 +0000 (UTC) for IP:'209.85.128.193' DOMAIN:'mail-wr0-f193.google.com' HELO:'mail-wr0-f193.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.193 mail-wr0-f193.google.com 209.85.128.193 mail-wr0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCH 06/22] esx_vi_generator: Simplify generate_helper_header 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: , MIME-Version: 1.0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 17 Mar 2018 14:24:41 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function generate_helper_header() only returns a formatted string. This could be achieved without performing string concatenation. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 19c225384..1641a2a1e 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1021,20 +1021,15 @@ class ManagedObject(GenericObject): =20 =20 def generate_helper_header(self): - header =3D "" - # functions - header +=3D ("int esxVI_Lookup%s(esxVI_Context *ctx, " - "const char *name, " - "esxVI_ManagedObjectReference *root,= " - "esxVI_String *selectedPropertyNameL= ist, " - "esxVI_%s **item, " - "esxVI_Occurrence occurrence);\n") \ - % (self.name, self.name) - - header +=3D "\n" - - return header + return ( + "int esxVI_Lookup{name}(esxVI_Context *ctx, " + "const char *name, " + "esxVI_ManagedObjectReference *root, " + "esxVI_String *selectedPropertyNameList= , " + "esxVI_{name} **item, " + "esxVI_Occurrence occurrence);\n\n" + ).format(name=3Dself.name) =20 =20 def generate_source(self): --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list