This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-release.git


The following commit(s) were added to refs/heads/master by this push:
     new b26c441  Allow default execution to omit mail config. (#321)
b26c441 is described below

commit b26c441149f91de58890e314942d725e86709279
Author: rodric rabbah <[email protected]>
AuthorDate: Sun Feb 2 15:24:49 2020 -0500

    Allow default execution to omit mail config. (#321)
    
    * Update yaml loader.
    * Allow default execution to omit mail config.
    * Make rc file positional argument.
    * Add mailer tip.
---
 docs/release_instructions.md | 11 +++++++++++
 tools/gen-release-vote.py    | 13 +++++--------
 tools/requirements.txt       |  2 +-
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/docs/release_instructions.md b/docs/release_instructions.md
index 04d6103..43218f7 100644
--- a/docs/release_instructions.md
+++ b/docs/release_instructions.md
@@ -145,6 +145,17 @@ If the release candidates pass all checks, commit them to 
the staging svn:
 Initiate a release vote on the dev list.
 Use the [gen-release-vote.py](../tools/gen-release-vote.py)
 script to create the body of the voting email.
+```
+./gen-release-vote.py ../release-configs/<MY_RELEASE_CONFIG>.json
+```
+
+This script accepts a [mailer configuration 
file](https://github.com/apache/openwhisk-release/blob/master/tools/mail-config-template.yaml)
 which you can use
+to also send the vote email directly to the mailing list. _You should dry run 
this command with `-n` to sanity check the vote notice before it is sent._
+
+```
+./gen-release-vote.py ../release-configs/<MY_RELEASE_CONFIG>.json -mc 
<MY_MAILER_CONFIG>.yaml
+```
+
 
 ### Report Vote Result
 
diff --git a/tools/gen-release-vote.py b/tools/gen-release-vote.py
index ab81e03..36df52b 100755
--- a/tools/gen-release-vote.py
+++ b/tools/gen-release-vote.py
@@ -38,9 +38,9 @@ def parseArgsAndConfig():
     parser.add_argument('-v', '--verbose', help='verbose output', 
action='store_true')
     parser.add_argument('-n', '--dryrun', help='verbose output', 
action='store_true')
     parser.add_argument('-mc', '--mail-conf', help='YAML configuration file 
for mailer', metavar='YAML', type=argparse.FileType('r'), required=False)
-    parser.add_argument('-rc', '--rc-conf', help='JSON configuration file for 
release candidate', metavar='JSON', type=argparse.FileType('r'), required=True)
     parser.add_argument('-s', '--subject', help='Component name for subject 
line', metavar='NAME')
     parser.add_argument('-i', '--signature', help='Signature line to conclude 
email', metavar='SIGNATURE')
+    parser.add_argument('rc-conf', help='JSON configuration file for release 
candidate', metavar='release-config-file', type=argparse.FileType('r'))
 
     if argcomplete:
         argcomplete.autocomplete(parser)
@@ -48,18 +48,15 @@ def parseArgsAndConfig():
     args = parser.parse_args()
 
     args.rcConfig = json.load(args.rc_conf)
-    if not args.dryrun:
-      if 'mail_conf' not in args:
-        parser.error("--mail-config required except for a dryrun.")
-
-      args.mailConfig = yaml.load(args.mail_conf)
+    if not args.dryrun and 'mail_conf' in args and args.mail_conf is not None:
+      args.mailConfig = yaml.load(args.mail_conf, Loader=yaml.FullLoader)
       if 'mail' not in args.mailConfig:
         print('Error: bad configuration, need "mail" properties.')
         return
       else:
         args.mailConfig = args.mailConfig['mail']
     else:
-        args.mailConfig = None
+      args.mailConfig = None
     return args
 
 def componentList(config, version):
@@ -152,7 +149,7 @@ This majority vote is open for at least 72 hours.
         rcverifies = rcverify(components, version),
         signature = ("\n%s" % signature) if signature else "")
 
-    if (dryrun):
+    if (dryrun or mailConfig is None):
       print(subject)
       print(content)
       return
diff --git a/tools/requirements.txt b/tools/requirements.txt
index 5500f00..cf87d0a 100644
--- a/tools/requirements.txt
+++ b/tools/requirements.txt
@@ -1 +1 @@
-PyYAML
+PyYAML==5.3

Reply via email to