From 191bf9d86bbdb1fb75a5e8db95a85ba4a826bd50 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Jul 08 2019 21:42:42 +0000 Subject: On auto-approve, only prompt on anomalies. .gitignore addition Bump version. --- diff --git a/.gitignore b/.gitignore index 84b4f8c..34643c6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ dist/ .coverage .vscode/ .pytest_cache/ +*~ diff --git a/fedscm_admin/utils.py b/fedscm_admin/utils.py index 888467b..a7f50d4 100644 --- a/fedscm_admin/utils.py +++ b/fedscm_admin/utils.py @@ -419,7 +419,10 @@ def prompt_for_new_repo(issue_json, issue_body_json, force=False, 'manually verify it.') click.secho(msg, fg='yellow') - action = prompt_for_ticket_action() + if auto_approve == False: + action = prompt_for_ticket_action() + else: + action = 'approve' if action == 'approve': # Create the PDC SLA entry @@ -468,7 +471,7 @@ def prompt_for_new_repo(issue_json, issue_body_json, force=False, 'You may commit to the branch "{1}" in about ' '10 minutes.'.format(dist_git_url, branch_name)) - comment_and_close_ticket(issue_id, bug_id, new_repo_comment) + comment_and_close_ticket(issue_id, bug_id, new_repo_comment, prompt_for_comment=False) elif action == 'deny': comment_body = click.prompt( 'Please enter a comment explaining the denial') @@ -561,7 +564,10 @@ def prompt_for_new_branch(issue_json, issue_body_json, auto_approve=False): click.echo(' Git Branch: {0}'.format(bool_to_word( create_git_branch))) - action = prompt_for_ticket_action() + if auto_approve == False: + action = prompt_for_ticket_action() + else: + action = 'approve' if action == 'approve': pagure_url = get_config_item(CONFIG, 'pagure_dist_git_url') @@ -591,7 +597,7 @@ def prompt_for_new_branch(issue_json, issue_body_json, auto_approve=False): 'the request, but in about 10 minutes, you may create the ' 'branch in Pagure using git.') comment_and_close_ticket(issue_id, bug_id, new_branch_comment, - prompt_for_comment=not auto_approved) + prompt_for_comment=False) elif action == 'deny': comment_body = click.prompt( 'Please enter a comment explaining the denial')