Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2fd4945

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

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎compute/oslogin/service_account_ssh.py

Copy file name to clipboardExpand all lines: compute/oslogin/service_account_ssh.py
+2-1Lines changed: 2 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.