summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorThomas Stringer <git@trstringer.com>2021-01-11 16:49:24 -0500
committerGitHub <noreply@github.com>2021-01-11 16:49:24 -0500
commit4f62ae8d01e8caca9039af067280ca2adad6ab6d (patch)
treed64a6046fadcaaf3fb48c6b1658445a8fb9edacc /cloudinit
parent88581e540728035c74af6173824e2cc517d13391 (diff)
downloadvyos-cloud-init-4f62ae8d01e8caca9039af067280ca2adad6ab6d.tar.gz
vyos-cloud-init-4f62ae8d01e8caca9039af067280ca2adad6ab6d.zip
Fix regression with handling of IMDS ssh keys (#760)
With the changes for SSH public keys to be retrieved from IMDS as a first option, when a key is passed through not in the raw SSH public key format it causes an issue and the key is not added to the user's authorized_keys file. This PR will temporarily disable this behavior until a permanent fix is put in place.
Diffstat (limited to 'cloudinit')
-rwxr-xr-xcloudinit/sources/DataSourceAzure.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 8a0bf91d..090dd66b 100755
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -651,6 +651,10 @@ class DataSourceAzure(sources.DataSource):
LOG.debug('Retrieving public SSH keys')
ssh_keys = []
try:
+ raise KeyError(
+ "Not using public SSH keys from IMDS"
+ )
+ # pylint:disable=unreachable
ssh_keys = [
public_key['keyData']
for public_key
@@ -1272,6 +1276,10 @@ class DataSourceAzure(sources.DataSource):
pubkey_info = None
try:
+ raise KeyError(
+ "Not using public SSH keys from IMDS"
+ )
+ # pylint:disable=unreachable
public_keys = self.metadata['imds']['compute']['publicKeys']
LOG.debug(
'Successfully retrieved %s key(s) from IMDS',