Skip to content

Commit

Permalink
Merge pull request mozilla#35 from Callek/issue35
Browse files Browse the repository at this point in the history
  • Loading branch information
Callek committed Apr 1, 2015
2 parents d2e9551 + 964f573 commit 7cac89b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions relengapi/blueprints/slaveloan/task_groups.py
Expand Up @@ -33,10 +33,7 @@ def generate_loan(slavetype, loanid):
prep_machine_info(loanid=loanid, slavetype=slavetype),
clean_secrets(loanid=loanid, slavetype=slavetype),
tasks.reboot_machine.si(loanid=loanid, waitforreboot=True),
group(
tasks.update_loan_bug_with_details.si(loanid=loanid),
tasks.email_loan_details.si(loanid=loanid)
)
notify_loan_done(loanid=loanid, slavetype=slavetype)
)


Expand Down Expand Up @@ -109,3 +106,11 @@ def clean_secrets(loanid, slavetype):
else:
# gpo does the secret cleaning for us
return tasks.dummy_task.si()


def notify_loan_done(loanid, slavetype):
return manual_action(loanid=loanid, action_name="notify_complete")
# return group(
# tasks.update_loan_bug_with_details.si(loanid=loanid),
# tasks.email_loan_details.si(loanid=loanid)
# )
7 changes: 7 additions & 0 deletions relengapi/blueprints/slaveloan/tasks.py
Expand Up @@ -236,6 +236,13 @@ def register_action_needed(self, loanid, action_name):
"Clean secrets from the machine. See instructions at "
"https://wiki.mozilla.org/ReleaseEngineering/How_To/Loan_a_Slave#Cleaning"
)
elif action_name == "notify_compelte":
action_message = (
"Notify the loanee in e-mail and the loan bug (Bug %s) that the loan is ready. "
"See template text for both in "
"https://wiki.mozilla.org/ReleaseEngineering/How_To/Loan_a_Slave#Notifying"
% l.bug_id
)
else:
raise ValueError("Invalid action name")
action = ManualActions(for_loan=l,
Expand Down

0 comments on commit 7cac89b

Please sign in to comment.