Skip to content

Commit 2fd4945

Browse files
authored
Avoid double-prefixing account with users/ (GoogleCloudPlatform#2051)
1 parent 96bd6b8 commit 2fd4945

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compute/oslogin/service_account_ssh.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def main(cmd, project, instance=None, zone=None,
107107
# Identify the service account ID if it is not already provided.
108108
account = account or requests.get(
109109
SERVICE_ACCOUNT_METADATA_URL, headers=HEADERS).text
110-
account = 'users/' + account
110+
if not account.startswith('users/'):
111+
account = 'users/' + account
111112

112113
# Create a new SSH key pair and associate it with the service account.
113114
private_key_file = create_ssh_key(oslogin, account)

0 commit comments

Comments
 (0)