def disable_machine_from_buildbot(slavetype, loanid): """ This celery grouping is for our need to disable a slave from taking buildbot jobs. AWS Loans should spinup without buildbot running/enabled, while inhouse needs to disable from slavealloc and make sure we're shut down Returns either a celery task, or a celery chain of actions. Expects previous celery task to return to it a machine name [not qualified by DNS] """ if slave_mappings.is_aws_serviceable(slavetype): return tasks.dummy_task.si() else: return chain(tasks.slavealloc_disable.s(loanid=loanid), tasks.start_disable_slave.s(loanid=loanid), tasks.waitfor_disable_slave.s(loanid=loanid))
def disable_machine_from_buildbot(slavetype, loanid): """ This celery grouping is for our need to disable a slave from taking buildbot jobs. AWS Loans should spinup without buildbot running/enabled, while inhouse needs to disable from slavealloc and make sure we're shut down Returns either a celery task, or a celery chain of actions. Expects previous celery task to return to it a machine name [not qualified by DNS] """ if slave_mappings.is_aws_serviceable(slavetype): return tasks.dummy_task.si() else: return chain( tasks.slavealloc_disable.s(loanid=loanid), tasks.start_disable_slave.s(loanid=loanid), tasks.waitfor_disable_slave.s(loanid=loanid) )
def prep_machine_info(slavetype, loanid): if slave_mappings.is_aws_serviceable(slavetype): return chain( manual_action(loanid=loanid, action_name="create_aws_system"), manual_action(loanid=loanid, action_name="add_to_vpn"), tasks.choose_aws_machine.si(loanid=loanid, loan_class=slavetype), group( tasks.fixup_machine.s(loanid=loanid), tasks.bmo_set_tracking_bug.s(loanid=loanid), ) ) else: return chain( tasks.choose_inhouse_machine.si(loanid=loanid, loan_class=slavetype), group( tasks.fixup_machine.s(loanid=loanid), tasks.bmo_set_tracking_bug.s(loanid=loanid), disable_machine_from_buildbot(slavetype, loanid), ), group( manual_action(loanid=loanid, action_name="add_to_vpn"), gpo_switch(loanid=loanid, slavetype=slavetype), ), )