xenial: cherry pick 4f62ae8#767
Merged
Merged
Conversation
Collaborator
Author
|
I've confirmed this works using my test from #761. |
blackboxsw
approved these changes
Jan 11, 2021
Collaborator
blackboxsw
left a comment
There was a problem hiding this comment.
LGTM:
- minor authorship diff
diff --git a/debian/changelog b/debian/changelog
index c6114ae7..2d8de46a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ cloud-init (20.4-0ubuntu1~16.04.2) xenial; 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:41:09 -0500
+ -- Chad Smith <chad.smith@canonical.com> Mon, 11 Jan 2021 15:26:17 -0700
cloud-init (20.4-0ubuntu1~16.04.1) xenial; urgency=medium
- build-package succeeds
- sbuilt-id succeeds
quilt push -aapplies the right functional diff andquilt pop -aremoves cleanly
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 04ff2131..d7f318c7 100755
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -266,7 +266,7 @@ BUILTIN_DS_CONFIG = {
},
'disk_aliases': {'ephemeral0': RESOURCE_DISK_PATH},
'dhclient_lease_file': LEASE_FILE,
- 'apply_network_config': True, # Use IMDS published network configuration
+ 'apply_network_config': False, # Use fallback network config not IMDS
}
# RELEASE_BLOCKER: Xenial and earlier apply_network_config default is False
@@ -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',
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.