Re: [PATCH sandbox-image 8/9] cli: Remove redundant global statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2018-04-18 at 21:57 +0100, Radostin Stoyanov wrote:
> 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-statement
> 
> Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
> ---
>  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=_("Connect string for libvirt"))
>  
>  def requires_template_dir(parser):
> -    global default_template_dir
>      parser.add_argument("-t", "--template-dir",
>                          default=default_template_dir,
>                          help=_("Template directory for saving templates"))
>  
>  def requires_image_dir(parser):
> -    global default_image_dir
>      parser.add_argument("-I", "--image-dir",
>                          default=default_image_dir,
>                          help=_("Image directory for saving images"))


ACK
--
Cedric

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux