power_LoadTest: Avoid invalid keyval access

The ext_*_failed_loads entries do not necessarily exist in keyvals,
e.g. there will be no ext_{audio,docs,email}_failed_loads when
web_1hour control is used.

This CL fixes the issue so that the summary of the task-specific PLTs
can be shown properly.

BUG=None
TEST=test_that $IP power_LoadTest.web_1hour
     Test passes without unhandled KeyError

Change-Id: I3b6687b4d0453a3fa8e6255d45008a3c9c36f0a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3180634
Tested-by: Fei Shao <fshao@chromium.org>
Auto-Submit: Fei Shao <fshao@chromium.org>
Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
Commit-Queue: Fei Shao <fshao@chromium.org>
diff --git a/client/site_tests/power_LoadTest/power_LoadTest.py b/client/site_tests/power_LoadTest/power_LoadTest.py
index d2ae96e..90710cb 100755
--- a/client/site_tests/power_LoadTest/power_LoadTest.py
+++ b/client/site_tests/power_LoadTest/power_LoadTest.py
@@ -573,6 +573,8 @@
         # Add audio/docs/email/web fail load to power dashboard
         for task in ('audio', 'docs', 'email', 'web'):
             key = 'ext_%s_failed_loads' % task
+            if key not in keyvals:
+                continue
             vals = (int(x) for x in keyvals[key].split('_'))
             for index, val in enumerate(vals):
                 log_name = 'loop%02d_%s_failed_load' % (index, task)