DPDK CI discussions
 help / color / mirror / Atom feed
From: Ali Alnubani <alialnu@nvidia.com>
To: <ci@dpdk.org>
Subject: [PATCH 2/2] pw_maintainers_cli: write errors to stderr
Date: Fri, 15 Apr 2022 13:16:11 +0300
Message-ID: <20220415101611.364-2-alialnu@nvidia.com> (raw)
In-Reply-To: <20220415101611.364-1-alialnu@nvidia.com>

Redirect error messages to stderr instead of stdout and
reword 2 of them.

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
---
 tools/pw_maintainers_cli.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
index ad51e3d..a1d7d8e 100755
--- a/tools/pw_maintainers_cli.py
+++ b/tools/pw_maintainers_cli.py
@@ -56,7 +56,7 @@ Or if you want to use inside other scripts:
 
 MAINTAINERS_FILE_PATH = os.environ.get('MAINTAINERS_FILE_PATH')
 if not MAINTAINERS_FILE_PATH:
-    print('MAINTAINERS_FILE_PATH is not set.')
+    print('MAINTAINERS_FILE_PATH is not set.', file=sys.stderr)
     sys.exit(1)
 
 
@@ -70,8 +70,7 @@ class GitPW(object):
         for key in conf_keys:
             value = conf_obj.get('pw_{}'.format(key))
             if not value:
-                print('--pw_{} is a required git-pw configuration'.format(key))
-                sys.exit(1)
+                sys.exit('--pw_{} is a required git-pw configuration'.format(key))
             else:
                 setattr(self.CONF, key, value)
 
@@ -97,8 +96,8 @@ class GitPW(object):
         users = api.index('users', [('q', delegate)])
         if len(users) != 1:
             # Zero or multiple users found
-            print('Cannot choose a Patchwork user to delegate to from '
-                  'user list ({}). Skipping..'.format(users))
+            print('Cannot choose a Patchwork user associated with {} to '
+                  'delegate to.'.format(delegate, users), file=sys.stderr)
             return
         for patch in patch_list:
             if patch['delegate'] != None and \
@@ -374,11 +373,13 @@ if __name__ == '__main__':
                                 r".*\<(?P<email>.*)\>",
                                 maintainer).group('email')
                     except AttributeError:
-                        print("Unexpected format: '{}'".format(maintainer))
+                        print("Unexpected format: '{}'".format(maintainer),
+                                file=sys.stderr)
                     delegate = _git_pw.set_delegate(
                             patch_list, maintainer_email,
                             skip_delegated=skip_delegated)
                     if delegate != None:
                         break
             else:
-                print('No maintainers found. Not setting a delegate.')
+                print('No maintainers matched. Not setting a delegate.',
+                        file=sys.stderr)
-- 
2.25.1


  reply	other threads:[~2022-04-15 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 10:16 [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Ali Alnubani
2022-04-15 10:16 ` Ali Alnubani [this message]
2022-04-25 17:18   ` [PATCH 2/2] pw_maintainers_cli: write errors to stderr Aaron Conole
2022-04-26  9:28     ` Ali Alnubani
2022-04-25 17:18 ` [PATCH 1/2] pw_maintainers_cli: try delegating to multiple maintainers Aaron Conole
2022-05-02 16:47   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220415101611.364-2-alialnu@nvidia.com \
    --to=alialnu@nvidia.com \
    --cc=ci@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK CI discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/ci/0 ci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ci ci/ http://inbox.dpdk.org/ci \
		ci@dpdk.org
	public-inbox-index ci

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.ci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git