From 0787ca519073d9c3118e0fda90d82092c336e5dd Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Oct 22 2014 06:46:17 +0000 Subject: relval: write current compose template, catch empty password On sub-commands that require login, complain on empty password. Also, update CurrentFedoraCompose in create-compose when --current is passed (report-results uses this, and other things probably will, though annoyingly the Current redirects can't.) --- diff --git a/scripts/relval b/scripts/relval index da52bb4..8ab6b24 100755 --- a/scripts/relval +++ b/scripts/relval @@ -79,6 +79,9 @@ def create_compose(args): type). Parameters passed in from the command line. """ password = getpass.getpass("Enter your FAS password: ", sys.stderr) + while len(password) == 0: + print("Password entered incorrectly. Please try again.") + password = getpass.getpass("Enter your FAS password: ", sys.stderr) try: wiki = setup_wiki(args.username, password, test=args.test) except: @@ -118,6 +121,14 @@ def create_compose(args): print("Updating Current redirect page...") page.update_current() + # Update the template that defines the 'current' compose (if asked) + if args.current is True: + try: + event.update_current() + except: + print("Unhandled error updating current template!") + raise + # Make sure the category hierarchy is all in place. print("Creating event category pages if necessary (or forced)...") for page in [event.category_page, event.parent_category_page]: @@ -255,6 +266,9 @@ def testcase_stats(args): def report_results(args): """Report some validation testing results.""" password = getpass.getpass("Enter your FAS password: ", sys.stderr) + while len(password) == 0: + print("Password entered incorrectly. Please try again.") + password = getpass.getpass("Enter your FAS password: ", sys.stderr) try: wiki = setup_wiki(args.username, password, test=args.test) except: