diff options
author | Chris Patterson <cpatterson@microsoft.com> | 2022-02-10 15:03:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 14:03:10 -0600 |
commit | 50de985bc4e47dff1a8fc52abb7679032bb40cae (patch) | |
tree | eec039c570ff733a202c6c7ef341fda3873b1c4f /cloudinit/sources/__init__.py | |
parent | c3482971f0f155475f367d6dec00bae25b79cfff (diff) | |
download | vyos-cloud-init-50de985bc4e47dff1a8fc52abb7679032bb40cae.tar.gz vyos-cloud-init-50de985bc4e47dff1a8fc52abb7679032bb40cae.zip |
sources/azure: refactor ssh key handling (#1248)
Split _get_public_ssh_keys_and_source() into
_get_public_keys_from_imds() and _get_public_keys_from_ovf().
Set _get_public_keys_from_imds() to take a parameter of the
IMDS metadata rather than assuming it is already set in
self.metadata. This will allow us to move negotation into
local phase where self.metadata may not be set yet. Update this
method to raise KeyError if IMDS metadata is missing/malformed,
and ValueError if SSH key format is not supported. Update
get_public_ssh_keys() to catch these errors and fall back to the
OVF/Wireserver keys as needed.
To improve clarity, update register_with_azure_and_fetch_data()
to return the list of SSH keys, rather than bundling them into
a dictionary for updating against the metadata dictionary.
There should be no change in behavior with this refactor.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
Diffstat (limited to 'cloudinit/sources/__init__.py')
0 files changed, 0 insertions, 0 deletions