Skip to content

Commit

Permalink
Fall back to meta-data/public-keys if meta-data/public-keys/0/openssh…
Browse files Browse the repository at this point in the history
…-key is not available.
  • Loading branch information
reyk committed May 7, 2018
1 parent eaa8b96 commit 9ffe04f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agent/cloudinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ cloudinit_fetch(struct system_config *sc)

/* pubkey */
if ((str = metadata(sc,
"/latest/meta-data/public-keys/0/openssh-key", LINE)) == NULL)
"/latest/meta-data/public-keys/0/openssh-key", LINE)) == NULL &&
(str = metadata(sc,
"/latest/meta-data/public-keys", LINE)) == NULL)
goto fail;
if (agent_addpubkey(sc, str, NULL) != 0)
goto fail;
Expand Down

0 comments on commit 9ffe04f

Please sign in to comment.