Fix duplicate entry Integrity Error when aborting from AFE
Currently aborting a suite job and its sub jobs from the afe causes
the AFE to spit out duplicate entry errors.
This is do the suite job aborting before a child job does and aborts
the child job. However the model object for that child job has not
been updated so we try to abort it as well and create a new
aborted host queue entry for it but it already exists.
Refactored the logic from abort to a class method that takes in a list
of HQE's to abort. This can be shared between abort and the rpc_interface
code.
BUG=chromium:242040
TEST=Started a suite, did a bulk abort and the error no longer occured.
Change-Id: I0d82506234bac5fea9307b5cd20c836cdf7ccb9c
Reviewed-on: https://gerrit.chromium.org/gerrit/60138
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
2 files changed