bionic: cherry pick 4f62ae8#765
Merged
Merged
Conversation
blackboxsw
approved these changes
Jan 11, 2021
Collaborator
blackboxsw
left a comment
There was a problem hiding this comment.
LGTM:
- tooling diff minor between authors:
diff --git a/debian/changelog b/debian/changelog
index 170dadba..79b21057 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ cloud-init (20.4-0ubuntu1~18.04.2) bionic; urgency=medium
* cherry-pick 4f62ae8d: Fix regression with handling of IMDS ssh keys
(#760) (LP: #1910835)
- -- Daniel Watkins <oddbloke@ubuntu.com> Mon, 11 Jan 2021 17:31:19 -0500
+ -- Chad Smith <chad.smith@canonical.com> Mon, 11 Jan 2021 15:25:54 -0700
cloud-init (20.4-0ubuntu1~18.04.1) bionic; urgency=medium
build-packagesucceedssbuilt-itsucceedsquilt push -a/pop -asucceeds with appropriate functional diff
csmith@downtown:/tmp/cloud-init (ubuntu/bionic)$ git diff cloudinit/sources/DataSourceAzure.py
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 04ff2131..647e3d28 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
@@ -1271,6 +1275,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',
Collaborator
Author
|
I've confirmed this works using my test from #761. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.