Fall back to meta-data/public-keys if meta-data/public-keys/0/openssh-key is not available.

This commit is contained in:
Reyk Floeter 2018-05-07 18:10:27 +02:00
parent eaa8b96541
commit 9ffe04f62f

View file

@ -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;