[libvirt] [jenkins-ci PATCH 03/20] quayadmin: Fix quiet mode for show-repo

Andrea Bolognani posted 20 patches 6 years, 6 months ago
There is a newer version of this series
[libvirt] [jenkins-ci PATCH 03/20] quayadmin: Fix quiet mode for show-repo
Posted by Andrea Bolognani 6 years, 6 months ago
Since the user is explicity asking for information to be
displayed, we should present it to them whether or not quiet
mode is enabled.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 guests/quayadmin | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guests/quayadmin b/guests/quayadmin
index 5dc5eff..980fc1b 100755
--- a/guests/quayadmin
+++ b/guests/quayadmin
@@ -84,8 +84,8 @@ def run_show_repo(args):
         return 1
 
     info = res.json()
-    if not args.quiet:
-        print("{}/{}: {}".format(args.namespace, args.repo, info["description"]))
+
+    print("{}/{}: {}".format(args.namespace, args.repo, info["description"]))
 
 
 def run_create_repo(args):
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 03/20] quayadmin: Fix quiet mode for show-repo
Posted by Daniel P. Berrangé 6 years, 6 months ago
On Wed, Jul 17, 2019 at 01:53:52PM +0200, Andrea Bolognani wrote:
> Since the user is explicity asking for information to be
> displayed, we should present it to them whether or not quiet
> mode is enabled.

The reason why I honoured the "quiet" flag in this command
was because it serves as a "does the repo exist" check,
and when used for that purpose avoids need to redirect
stdout to /dev/null.

> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  guests/quayadmin | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/guests/quayadmin b/guests/quayadmin
> index 5dc5eff..980fc1b 100755
> --- a/guests/quayadmin
> +++ b/guests/quayadmin
> @@ -84,8 +84,8 @@ def run_show_repo(args):
>          return 1
>  
>      info = res.json()
> -    if not args.quiet:
> -        print("{}/{}: {}".format(args.namespace, args.repo, info["description"]))
> +
> +    print("{}/{}: {}".format(args.namespace, args.repo, info["description"]))

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [jenkins-ci PATCH 03/20] quayadmin: Fix quiet mode for show-repo
Posted by Andrea Bolognani 6 years, 6 months ago
On Wed, 2019-07-17 at 13:00 +0100, Daniel P. Berrangé wrote:
> On Wed, Jul 17, 2019 at 01:53:52PM +0200, Andrea Bolognani wrote:
> > Since the user is explicity asking for information to be
> > displayed, we should present it to them whether or not quiet
> > mode is enabled.
> 
> The reason why I honoured the "quiet" flag in this command
> was because it serves as a "does the repo exist" check,
> and when used for that purpose avoids need to redirect
> stdout to /dev/null.

Okay, that makes sense. I'll drop this commit and make sure all
other show-* commands also behave this way.

-- 
Andrea Bolognani / Red Hat / Virtualization

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