diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2019-07-26 20:40:18 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-07-26 20:40:18 +0000 |
commit | 496aaa947ec563bd02b3148f220ff0afe1b32abb (patch) | |
tree | 447ccd21a9d67a69ba40eae215feabf8039c6383 /cloudinit/sources/DataSourceOracle.py | |
parent | 1dbede64dc645b090b4047a105143b5d5090d214 (diff) | |
download | vyos-cloud-init-496aaa947ec563bd02b3148f220ff0afe1b32abb.tar.gz vyos-cloud-init-496aaa947ec563bd02b3148f220ff0afe1b32abb.zip |
net/cmdline: split interfaces_by_mac and init network config determination
Previously "cmdline" network configuration could be either
user-specified network-config=... configuration data, or
initramfs-provided configuration data. Before data sources could modify
the order in which network config sources were considered, this
conflation didn't matter (and, indeed, in the default data source
configuration it will continue to not matter).
However, it _is_ desirable for a data source to be able to specify that
its network configuration should be preferred over the
initramfs-provided network configuration but still allow explicit
network-config=... configuration passed to the kernel cmdline to
continue to override both of those sources.
(This also modifies the Oracle data source to use read_initramfs_config
directly, which is effectively what it was using
read_kernel_cmdline_config for previously.)
Diffstat (limited to 'cloudinit/sources/DataSourceOracle.py')
-rw-r--r-- | cloudinit/sources/DataSourceOracle.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cloudinit/sources/DataSourceOracle.py b/cloudinit/sources/DataSourceOracle.py index 70b9c58a..76cfa38c 100644 --- a/cloudinit/sources/DataSourceOracle.py +++ b/cloudinit/sources/DataSourceOracle.py @@ -48,7 +48,7 @@ class DataSourceOracle(sources.DataSource): return False # network may be configured if iscsi root. If that is the case - # then read_kernel_cmdline_config will return non-None. + # then read_initramfs_config will return non-None. if _is_iscsi_root(): data = self.crawl_metadata() else: @@ -118,10 +118,8 @@ class DataSourceOracle(sources.DataSource): We nonetheless return cmdline provided config if present and fallback to generate fallback.""" if self._network_config == sources.UNSET: - cmdline_cfg = cmdline.read_kernel_cmdline_config() - if cmdline_cfg: - self._network_config = cmdline_cfg - else: + self._network_config = cmdline.read_initramfs_config() + if not self._network_config: self._network_config = self.distro.generate_fallback_config() return self._network_config @@ -137,7 +135,7 @@ def _is_platform_viable(): def _is_iscsi_root(): - return bool(cmdline.read_kernel_cmdline_config()) + return bool(cmdline.read_initramfs_config()) def _load_index(content): |