* Cleanup

gam,py:
In show sakays, only mark USER-MANAGED keys as current: true/false

gapi/__init__.py:
pylint cleanup: import order, indentation

gapi/errors.py:
pylint cleanup: import order, unused import, indentation

Recognize 502 Bad Gateway/Gateway Timeout: treat as retryable errors

This last change does not directly handle the refresh problem in Issue #1063 but in my version this seems to be the right solution to the 502 gateways errors

* In show sakeys, indicate whcij key was used to authenticate

* Show all sakeys by default

* Include unused import

* Remove unused import, fix unit tests
This commit is contained in:
Ross Scroggs
2020-01-01 12:04:45 -08:00
committed by Jay Lee
parent 2c0a005d3e
commit 497251186d
3 changed files with 146 additions and 127 deletions

View File

@@ -7840,7 +7840,7 @@ def _formatOAuth2ServiceData(private_key, private_key_id):
def doShowServiceAccountKeys():
iam = buildGAPIServiceObject('iam', None)
keyTypes = 'USER_MANAGED'
keyTypes = None
i = 3
while i < len(sys.argv):
myarg = sys.argv[i].lower().replace('_', '')
@@ -7867,7 +7867,8 @@ def doShowServiceAccountKeys():
print('{0}: {1}'.format(parts[i][:-1], parts[i+1]))
for key in keys:
key['name'] = key['name'].rsplit('/', 1)[-1]
key['current'] = key['name'] == currentPrivateKeyId
if key['name'] == currentPrivateKeyId:
key['usedToAuthenticateThisRequest'] = True
print_json(None, keys)
def doRotateServiceAccountKeys():