Fix AttributeError accessing the return code.

Additionally, retry on error code 56; roughly, TLS packet w/
unexpected length.  Basically is either corruption (unlikely) or
bad server side generation (more likely).

BUG=None
TEST=None

Change-Id: I13478db695ce34480f15e25d92a0b5d13de3a70b
Reviewed-on: https://gerrit.chromium.org/gerrit/23308
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index d656f0f..18421e7 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -105,13 +105,13 @@
     # occasionally.
     # Finally, we do not use curl's --retry option since it generally doesn't
     # actually retry anything; code 18 for example, it will not retry on.
-    retriable_exits = frozenset([5, 6, 7, 15, 18, 22, 26, 28, 52])
+    retriable_exits = frozenset([5, 6, 7, 15, 18, 22, 26, 28, 52, 56])
     try:
       return cros_build_lib.RunCommandWithRetries(
           5, cmd, sleep=3, retry_on=retriable_exits, **kwargs)
     except cros_build_lib.RunCommandError, e:
       code = e.result.returncode
-      if e.returncode in (51, 58, 60):
+      if code in (51, 58, 60):
         # These are the return codes of failing certs as per 'man curl'.
         print 'Download failed with certificate error? Try "sudo c_rehash".'
       else: