From nobody Wed May 14 13:17:24 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 1524085106391351.42472298842483; Wed, 18 Apr 2018 13:58:26 -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 B56BB30014C1; Wed, 18 Apr 2018 20:58:24 +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 AF6CB7F6C0; 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 B4A214CA99; 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 w3IKwIQ3013403 for ; Wed, 18 Apr 2018 16:58:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 63E457D665; Wed, 18 Apr 2018 20:58:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DCAD7D911 for ; Wed, 18 Apr 2018 20:58:16 +0000 (UTC) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) (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 7832931325B0 for ; Wed, 18 Apr 2018 20:58:05 +0000 (UTC) Received: by mail-wr0-f178.google.com with SMTP id h3-v6so8364918wrh.5 for ; Wed, 18 Apr 2018 13:58:05 -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.58.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 13:58:03 -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=KLxpLebzEmObqFKBOeYuq+d2+dQIueB1wf5uUKd/f74=; b=TMr+tpwjs28eIvWSxTG1VG+Td1Ut5BRoUV5qWL5mxiiHB5rV0JVJ99BwN76xxdHtee OjkcxjAYhQ39w7x2Cwq6jcMKKXOGXMzM/C31DweY8bp9QCB4THZBYtjj0SbFmBhBop/y 8aSji1fBvhBRk0coV+fcsdRPbK+9BDWdFQZPTvQmiSr4H3PfZcYap/dI5TKcV36nToGO qm5IHIAs3tPFItThaqnxy5RAUjSiXCkCwdtYDGq7t1iGYavddMJ68COVrDmo1Ckl5cEh TUIMgmjzUOLZFe10rTYp8jtoAqUBLhUWczs6FtD/O0aEmYdz6axVZwSz4DM02HTfc02Z IEPw== 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=KLxpLebzEmObqFKBOeYuq+d2+dQIueB1wf5uUKd/f74=; b=NpxI9UnusCbpPnFJDPLzSu/6ym/GhrnDt592wqGVEdRRuWzcM7vfm/ZZ2RIQE/gGxX iV0jSvIjCEJpXHhGPh8WetEayjynm3Yh7PwxIJFxh2awrGPEOz0uV1uzKiphW6NdylD2 JEEVOvUpq5L9NQbQMLqU9ivUvb3rlfpqmk/lUEr368EmSxLgHUStf/AphZrEuUqcIpy0 b/hMLkOwfC4Fz2PudY2oLHDTKBfYT6/FmLMOYioZo6le/5k7bIn9PKLpk0MBeyoO6AMM 83bsNeZ4CT2e2e1HjrC/PmIk2ndGsUC6erqNU4+savigz2uBlg+vrQwmFpksL5XqjSli JRag== X-Gm-Message-State: ALQs6tBc+jxnxzAoFQbmFXnFhpRMWB9a837oPWdkbps6+qAe+WVjtgCJ GHlvOL1YOYPe6olSpoVmhJFOsR7+ X-Google-Smtp-Source: AIpwx49WVjJqMnJaBArzxGVtgIRuTGSqhIODiT87U42S8a/dpo49XS7vjKvlgdMbA9MhjQq1khnR4Q== X-Received: by 2002:adf:ad46:: with SMTP id p64-v6mr2508262wrc.44.1524085083940; Wed, 18 Apr 2018 13:58:03 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 21:57:46 +0100 Message-Id: <20180418205747.28848-9-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.48]); Wed, 18 Apr 2018 20:58:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 18 Apr 2018 20:58:05 +0000 (UTC) for IP:'209.85.128.178' DOMAIN:'mail-wr0-f178.google.com' HELO:'mail-wr0-f178.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.178 mail-wr0-f178.google.com 209.85.128.178 mail-wr0-f178.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 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 8/9] cli: Remove redundant global statements 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.40]); 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" The global statement is needed for assignment of variables in global scope [1]. In this case, we only read the value of those variables, therefore we do not need to explicitly use the global statement. [1] https://docs.python.org/3/reference/simple_stmts.html#the-global-statem= ent Signed-off-by: Radostin Stoyanov --- libvirt_sandbox_image/cli.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/libvirt_sandbox_image/cli.py b/libvirt_sandbox_image/cli.py index e96d422..95c5147 100644 --- a/libvirt_sandbox_image/cli.py +++ b/libvirt_sandbox_image/cli.py @@ -167,13 +167,11 @@ def requires_connect(parser): help=3D_("Connect string for libvirt")) =20 def requires_template_dir(parser): - global default_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", default=3Ddefault_image_dir, help=3D_("Image directory for saving images")) --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list