pushimage: push keyset loading down to allow for input flexibility

Sometimes we do want sub-artifacts to sign with a different keyset, like
when a firmware builder also produces accessory firmware.  The current
code will only check the keysets from the main file and then ignore any
setting in the sub-file.  Instead, delay the keyset loading to after we
know the image type so we can pull it from the specific input file.

BUG=chrome-os-partner:46635
TEST=`./cbuildbot/run_tests` passes
TEST=`./pushimage -n gs://foo/ --board smaug --debug` with custom input insns shows correct output insns

Change-Id: I8ed170e43b6e2c115d39dfdc772fbc93054cc9d7
Reviewed-on: https://chromium-review.googlesource.com/311280
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2 files changed