From 066f96cf8a355f1375cf85fcf04063e41cb7c375 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Tue, 25 Apr 2017 15:57:31 -0400 Subject: [PATCH] show daemon version before releasing --- build/release.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build/release.py b/build/release.py index 7ecfa32cd..1a8392160 100644 --- a/build/release.py +++ b/build/release.py @@ -16,6 +16,7 @@ import github import changelog ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) +DAEMON_URL_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'DAEMON_URL') def main(): @@ -37,6 +38,11 @@ def main(): print 'Current version: {}'.format(repo.current_version) print 'New version: {}'.format(repo.new_version) + with open(DAEMON_URL_FILE, 'r') as f: + daemon_url_template = f.read().strip() + daemon_version = re.search('/(?Pv[^/]+)', daemon_url_template) + print 'Daemon version: {} ({})'.format( + daemon_version.group('version'), daemon_url_template) if not args.confirm and not confirm(): print "Aborting" @@ -157,7 +163,10 @@ in the future""" def confirm(): - return raw_input('Is this what you want? [y/N] ').strip().lower() == 'y' + try: + return raw_input('Is this what you want? [y/N] ').strip().lower() == 'y' + except KeyboardInterrupt: + return False def run_sanity_checks(repo, branch): @@ -181,9 +190,8 @@ def run_sanity_checks(repo, branch): def check_daemon_urls(): - daemon_url_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'DAEMON_URL') success = True - with open(daemon_url_file, 'r') as f: + with open(DAEMON_URL_FILE, 'r') as f: daemon_url_template = f.read().strip() if "OSNAME" not in daemon_url_template: print "Daemon URL must include the string 'OSNAME'"