Autotest: Fix Reverification Code so we don't get stuck in a loop.

Currently if the scheduler dies in a bad state it gets stuck in a loop
as it tries to create cleanup jobs on machines that were left in
Repairing, Verifying, Cleanup.

However the call to create the Cleanup Task is not implemented correctly
and will cause an error as it tries to modify the database and create
the job.

In order to fix this I fill in the missing argument (requested_by) by a
User object which I default with an id of 1 (we can change this in
review, but it must be a proper id from afe_users). This seems to fix the
issue and we should recover properly after dying poorly from now on.

BUG=chromium-os:33150
TEST=On my own setup, I set a host to 'Repairing' status verified that
the bug occured as monitor_db starts up. Then I added my fix and then
started monitor_db where it properly created the cleanup job and
recovered properly. Tested autotest_system id lookup on the test server
'chromeos-autotest.cbf'.

Change-Id: I4a555002e8bfc69ffd08d99261c7a28a4ebf5fbf
Reviewed-on: https://gerrit.chromium.org/gerrit/31008
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Simran Basi <sbasi@google.com>
Reviewed-by: Simran Basi <sbasi@google.com>
Tested-by: Simran Basi <sbasi@google.com>
2 files changed