net: ubuntu focal prioritize netplan over eni even if both present#267
Merged
blackboxsw merged 4 commits intoMar 31, 2020
Merged
Conversation
50a78c3 to
ab0f955
Compare
raharper
suggested changes
Mar 24, 2020
ab0f955 to
93b1152
Compare
3a39691 to
9d94e73
Compare
raharper
suggested changes
Mar 27, 2020
Collaborator
raharper
left a comment
There was a problem hiding this comment.
Let's add a unittest for this.
+ @mock.patch("cloudinit.net.renderers.netplan.available")
+ @mock.patch("cloudinit.net.renderers.sysconfig.available")
+ @mock.patch("cloudinit.net.renderers.sysconfig.available_sysconfig")
+ @mock.patch("cloudinit.net.renderers.sysconfig.available_nm")
+ @mock.patch("cloudinit.net.renderers.eni.available")
+ @mock.patch("cloudinit.net.renderers.sysconfig.util.get_linux_distro")
+ def test_netplan_selected_with_ifupdown_installed(self, m_distro,
+ m_eni, m_sys_nm,
+ m_sys_scfg,
+ m_sys_avail,
+ m_netplan):
+ """default policy selects netplan over eni when both installed."""
+
+ # Ubuntu with eni and netplan installed
+ m_netplan.return_value = True # netplan is installed
+ m_eni.return_value = True # ifupdown is installed
+ m_sys_scfg.return_value = False # no sysconfig/ifup/ifdown
+ m_sys_nm.return_value = False # no network-manager
+ m_sys_avail.return_value = False # no sysconfig on Ubuntu
+ m_distro.return_value = ('ubuntu', None, None)
+ priority = renderers.DEFAULT_PRIORITY
+ self.assertEqual('netplan', renderers.select(priority=priority)[0])
+
3bc8c19 to
365efb6
Compare
83a31e6 to
896782e
Compare
Collaborator
Author
|
Added some pytests for both renderers.select() and ./tools/render-cloudcfg |
raharper
approved these changes
Mar 30, 2020
Contributor
|
@blackboxsw land and upload please |
takumin
added a commit
to takumin/mitamae-cloud-image
that referenced
this pull request
Apr 27, 2020
This was referenced May 12, 2023
Closed
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.
On Focal and later, Ubuntu will prioritize netplan renderer before eni, even if ifupdown
and netplan are both installed. ENI on Bionic and later is considered an unsupported
configuration and so cloud-init should generally prefer netplan to eni rendering because
/etc/network/interfaces config file on many cloud images disables including cloud-init's
/etc/network/interfaces.d/50-cloud-init.cfg file.
Ubuntu series-specific changes may be applied to Bionic and Eoan, but further
discussion is warranted about the best approach on released series.
LP: #1867029