Only run inventory jobs on the primary server.

The DUT inventory cron jobs run on both the primary and backup
master.  This generates duplicate e-mail.  Stop the duplication by
having the jobs do nothing unless we're the primary server.

This also re-arranges the script to simplify running tests locally.

BUG=chromium:449376
TEST=run using the new test feature

Change-Id: I33246e511f65394bc67f82c7e190ac95cab6f89b
Reviewed-on: https://chromium-review.googlesource.com/254711
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
2 files changed