From nobody Wed May 14 13:20:41 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 1524085106361649.4569869442357; Wed, 18 Apr 2018 13:58:26 -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 9BA493262263; Wed, 18 Apr 2018 20:58:24 +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 ADA647D660; Wed, 18 Apr 2018 20:58:23 +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 7846B180215E; Wed, 18 Apr 2018 20:58:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IKwI6J013404 for ; Wed, 18 Apr 2018 16:58:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6447A7D67D; Wed, 18 Apr 2018 20:58:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DD857D922 for ; Wed, 18 Apr 2018 20:58:13 +0000 (UTC) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) (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 0534C316255C for ; Wed, 18 Apr 2018 20:58:02 +0000 (UTC) Received: by mail-wr0-f172.google.com with SMTP id h3-v6so8364583wrh.5 for ; Wed, 18 Apr 2018 13:58:01 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id y7sm708743wmy.30.2018.04.18.13.57.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 13:57:59 -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=efzBswo/c7TMrVmo7QqcNSYP4yVc56QSfI6zHqc9yDA=; b=IOuLz+tF7DMnoEWWUKV4vix2umqMBGoQ48O2l13cSNJiOdCDzQkNX+IquP/TlrckLw 8U3ycQzqKVEzVv09W1UawEgRnNYzmP/FwlMw3GJrDcVwQrpTnTd3N0YHZMIkbxJAzAGm wnctLtiVpQV3MWWNRGydo8M0Tfw++jFxBubJIaQxFc4NYJcwCfEkRmnJ4TCZaDk6LxKM 5uiLw8UFBvIvfoRcxgItZisqJd+lQxUC42N/tAkPauk75n2SIUm+QmtJzzh8Rt/hzTOr lb86Kek2+Jgq10Itn4/jeSUpPQ7lfYWgGvJIYZLt93lvxwz06PWtHJC8XkH2E75DCXl1 VRgw== 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=efzBswo/c7TMrVmo7QqcNSYP4yVc56QSfI6zHqc9yDA=; b=uXuETQ5UsMa68C8+dzYH/U54pUtkBzsGKITk6v7ffSk1FOl2E9HG9yvatCHbmgmSKJ bjL463mAJ+a1AeAU77bYYitjNFDNBNPjTDFBqYW7OvyHdzCSxZlB7u2+plDQZ/5ruCYH HHTHuCHc+J/X4Is0LkfHMuzripT3Z9eiJ4rW/l8tbDLnVQ1bVEJiz2OQspHioquYWLEZ jKjWlubx88vuiyCsxDId6hGjbg/ZVBeJBqVvg1qZsbCOlmba6Mt3upnwwxILCt8GQdM3 ja9qp4LWXEKQTOXDoTBj4J8Tc7OXzTdqhmZjSIXcre1OfGBd39vzitZ8j5K/ILRQFeb1 zA6Q== X-Gm-Message-State: ALQs6tBUXJ4Pz3TkAHvY1hNijdekgh730ikSyTrQiKjWIKABeg752fis 2jv+A83/eeM+J3u5ym2VCyeSceHd X-Google-Smtp-Source: AIpwx48Yx9eBHjHzHz1VuHsnotWchgvepd+YuOCN4W7GLKZh+9rsi1Tsc278pHnhxL8RVYNN40YfnQ== X-Received: by 10.28.71.77 with SMTP id u74mr2935184wma.149.1524085080316; Wed, 18 Apr 2018 13:58:00 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 21:57:43 +0100 Message-Id: <20180418205747.28848-6-rstoyanov1@gmail.com> In-Reply-To: <20180418205747.28848-1-rstoyanov1@gmail.com> References: <20180418205747.28848-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 18 Apr 2018 20:58:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 18 Apr 2018 20:58:02 +0000 (UTC) for IP:'209.85.128.172' DOMAIN:'mail-wr0-f172.google.com' HELO:'mail-wr0-f172.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.55 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.128.172 mail-wr0-f172.google.com 209.85.128.172 mail-wr0-f172.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCH sandbox-image 5/9] pylint: Fix white-space around keywords 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 18 Apr 2018 20:58:25 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This changes aim to resolve Pylint C0326. http://pylint-messages.wikidot.com/messages:c0326 Signed-off-by: Radostin Stoyanov --- libvirt_sandbox_image/cli.py | 26 +++++++++++++-----------= -- libvirt_sandbox_image/sources/base.py | 4 ++-- libvirt_sandbox_image/sources/docker.py | 4 ++-- libvirt_sandbox_image/sources/virtbuilder.py | 4 ++-- libvirt_sandbox_image/template.py | 4 ++-- setup.py | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libvirt_sandbox_image/cli.py b/libvirt_sandbox_image/cli.py index ec5fd6d..08c88a4 100644 --- a/libvirt_sandbox_image/cli.py +++ b/libvirt_sandbox_image/cli.py @@ -48,7 +48,7 @@ gettext.textdomain("libvirt-sandbox") try: gettext.install("libvirt-sandbox", localedir=3D"/usr/share/locale", - codeset =3D 'utf-8') + codeset=3D'utf-8') except IOError: import builtins builtins.__dict__['_'] =3D str @@ -109,7 +109,7 @@ def run(args): if args.connect is not None: cmd.append("-c") cmd.append(args.connect) - params =3D ['-m','host-image:/=3D%s,format=3Dqcow2' % diskfile] + params =3D ['-m', 'host-image:/=3D%s,format=3Dqcow2' % diskfile] =20 networkArgs =3D args.network if networkArgs is not None: @@ -144,40 +144,40 @@ def list_cached(args): tmpls.extend(template.Template.get_all(source, "%s/%s" % (args.templat= e_dir, source))) for tmpl in tmpls: - print (tmpl) + print(tmpl) =20 def requires_template(parser): parser.add_argument("template", help=3D_("URI of the template")) =20 def requires_name(parser): - parser.add_argument("-n","--name", + parser.add_argument("-n", "--name", help=3D_("Name of the running sandbox")) =20 def requires_debug(parser): - parser.add_argument("-d","--debug", + parser.add_argument("-d", "--debug", default=3DFalse, action=3D"store_true", help=3D_("Run in debug mode")) =20 def check_connect(connectstr): - supportedDrivers =3D ['lxc:///','qemu:///session','qemu:///system'] + supportedDrivers =3D ['lxc:///', 'qemu:///session', 'qemu:///system'] if not connectstr in supportedDrivers: raise ValueError("URI '%s' is not supported by virt-sandbox-image"= % connectstr) return True =20 def requires_connect(parser): - parser.add_argument("-c","--connect", + parser.add_argument("-c", "--connect", help=3D_("Connect string for libvirt")) =20 def requires_template_dir(parser): global default_template_dir - parser.add_argument("-t","--template-dir", + parser.add_argument("-t", "--template-dir", default=3Ddefault_template_dir, help=3D_("Template directory for saving templates"= )) =20 def requires_image_dir(parser): global default_image_dir - parser.add_argument("-I","--image-dir", + parser.add_argument("-I", "--image-dir", default=3Ddefault_image_dir, help=3D_("Image directory for saving images")) =20 @@ -222,9 +222,9 @@ def gen_run_args(subparser): parser.add_argument("args", nargs=3Dargparse.REMAINDER, help=3D_("command arguments to run")) - parser.add_argument("-N","--network", + parser.add_argument("-N", "--network", help=3D_("Network params for running template")) - parser.add_argument("-e","--env",action=3D"append", + parser.add_argument("-e", "--env", action=3D"append", help=3D_("Environment params for running template"= )) =20 parser.set_defaults(func=3Drun) @@ -234,7 +234,7 @@ def gen_list_args(subparser): _("List locally cached images")) requires_template_dir(parser) =20 - parser.add_argument("-s","--source", + parser.add_argument("-s", "--source", help=3D_("Name of the template source")) =20 parser.set_defaults(func=3Dlist_cached) @@ -275,5 +275,5 @@ def main(): sys.stderr.flush() sys.exit(1) except Exception as e: - print (e) + print(e) sys.exit(1) diff --git a/libvirt_sandbox_image/sources/base.py b/libvirt_sandbox_image/= sources/base.py index 0fc9243..c132489 100644 --- a/libvirt_sandbox_image/sources/base.py +++ b/libvirt_sandbox_image/sources/base.py @@ -127,13 +127,13 @@ class Source(): =20 # Utility functions to share between the sources. =20 - def format_disk(self,disk,format,connect): + def format_disk(self, disk, format, connect): cmd =3D ['virt-sandbox'] if connect is not None: cmd.append("-c") cmd.append(connect) cmd.append("-p") - params =3D ['--disk=3Dfile:disk_image=3D%s,format=3D%s' %(disk,for= mat), + params =3D ['--disk=3Dfile:disk_image=3D%s,format=3D%s' %(disk, fo= rmat), '/sbin/mkfs.ext3', '/dev/disk/by-tag/disk_image'] cmd =3D cmd + params diff --git a/libvirt_sandbox_image/sources/docker.py b/libvirt_sandbox_imag= e/sources/docker.py index 94eb6d1..3ca1b10 100755 --- a/libvirt_sandbox_image/sources/docker.py +++ b/libvirt_sandbox_image/sources/docker.py @@ -533,7 +533,7 @@ class DockerSource(base.Source): parentImage =3D None for imagetagid in imagelist: templateImage =3D templatedir + "/" + imagetagid + "/template.= qcow2" - cmd =3D ["qemu-img","create","-f","qcow2"] + cmd =3D ["qemu-img", "create", "-f", "qcow2"] if parentImage is not None: cmd.append("-o") cmd.append("backing_fmt=3Dqcow2,backing_file=3D%s" % paren= tImage) @@ -657,7 +657,7 @@ class DockerSource(base.Source): tempfile =3D imagedir + "/" + sandboxname.split('/')[-1] + ".qcow2" if not os.path.exists(imagedir): os.makedirs(imagedir) - cmd =3D ["qemu-img","create","-q","-f","qcow2"] + cmd =3D ["qemu-img", "create", "-q", "-f", "qcow2"] cmd.append("-o") cmd.append("backing_fmt=3Dqcow2,backing_file=3D%s" % diskfile) cmd.append(tempfile) diff --git a/libvirt_sandbox_image/sources/virtbuilder.py b/libvirt_sandbox= _image/sources/virtbuilder.py index ba554e8..5e723e6 100755 --- a/libvirt_sandbox_image/sources/virtbuilder.py +++ b/libvirt_sandbox_image/sources/virtbuilder.py @@ -93,7 +93,7 @@ class VirtBuilderSource(base.Source): def get_command(self, template, templatedir, userargs): return userargs =20 - def get_disk(self,template, templatedir, imagedir, sandboxname): + def get_disk(self, template, templatedir, imagedir, sandboxname): diskfile =3D "%s/%s.qcow2" % (templatedir, self._get_template_name= (template)) tempfile =3D imagedir + "/" + sandboxname + ".qcow2" if not os.path.exists(imagedir): @@ -105,5 +105,5 @@ class VirtBuilderSource(base.Source): subprocess.check_call(cmd) return tempfile =20 - def get_env(self,template, templatedir): + def get_env(self, template, templatedir): return [] diff --git a/libvirt_sandbox_image/template.py b/libvirt_sandbox_image/temp= late.py index 25c43e6..a69ef53 100644 --- a/libvirt_sandbox_image/template.py +++ b/libvirt_sandbox_image/template.py @@ -71,7 +71,7 @@ class Template(object): classimpl =3D getattr(mod, classname) return classimpl() except Exception as e: - print (e) + print(e) raise Exception("Invalid source: '%s'" % source) =20 def get_source_impl(self): @@ -120,7 +120,7 @@ class Template(object): if o.query is not None and o.query !=3D "": for param in o.query.split("&"): (key, val) =3D param.split("=3D") - query[key] =3D val + query[key] =3D val return klass(source, protocol, o.hostname, o.port, o.username, o.password, diff --git a/setup.py b/setup.py index dd22fd5..0b16ae7 100644 --- a/setup.py +++ b/setup.py @@ -96,10 +96,10 @@ setup( "libvirt_sandbox_image/sources" ], install_requires=3D[], - cmdclass =3D { + cmdclass=3D{ 'build': my_build, }, - classifiers =3D [ + classifiers=3D[ "License :: OSI Approved :: GNU Lesser General Public License v2 o= r later (LGPLv2+)", "Programming Language :: Python", "Programming Language :: Python :: 3", --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list