summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-06-20 15:44:39 -0600
committerChad Smith <chad.smith@canonical.com>2018-06-21 14:16:22 -0600
commitb4e77335a122e18e342bf58b87f5458abcaf97e0 (patch)
tree6c5960648c7aa6672e3fe5dc90bafe15725d943b /debian
parentb6562857ca3a732423befdf5a06ace28c2a44b6f (diff)
downloadvyos-cloud-init-b4e77335a122e18e342bf58b87f5458abcaf97e0.tar.gz
vyos-cloud-init-b4e77335a122e18e342bf58b87f5458abcaf97e0.zip
Fallback network config instead of network_data.json for OpenStack
To make this acceptable as a SRU we keep the same behavior as is in the stable release which is to generate network for fallback nic only. In this series, OpenStack datasource can optionally generate network_config from network_data.json if the datasource is configured with a file like /etc/cloud.cfg.d/openstack-net.cfg: datasource: OpenStack: apply_network_config: true
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/openstack-no-network-config.patch42
-rw-r--r--debian/patches/series1
2 files changed, 43 insertions, 0 deletions
diff --git a/debian/patches/openstack-no-network-config.patch b/debian/patches/openstack-no-network-config.patch
new file mode 100644
index 00000000..67493548
--- /dev/null
+++ b/debian/patches/openstack-no-network-config.patch
@@ -0,0 +1,42 @@
+Description: Fallback network config instead of network_data.json for OpenStack
+ To make this acceptable as a SRU we keep the same behavior as is
+ in the stable release which is to generate network for fallback nic
+ only.
+ .
+ In this series, OpenStack datasource can optionally generate
+ network_config from network_data.json if the datasource is configured
+ with a file like /etc/cloud.cfg.d/openstack-net.cfg:
+ .
+ datasource:
+ OpenStack:
+ apply_network_config: true
+Forwarded: not-needed
+Author: Chad Smith <chad.smith@canonical.com>
+
+--- a/cloudinit/sources/DataSourceOpenStack.py
++++ b/cloudinit/sources/DataSourceOpenStack.py
+@@ -97,10 +97,9 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
+ if self._network_config != sources.UNSET:
+ return self._network_config
+
+- # RELEASE_BLOCKER: SRU to Xenial and Artful SRU should not provide
++ # Xenial, Artful and Bionic will not provide
+ # network_config by default unless configured in /etc/cloud/cloud.cfg*.
+- # Patch Xenial and Artful before release to default to False.
+- if util.is_false(self.ds_cfg.get('apply_network_config', True)):
++ if util.is_false(self.ds_cfg.get('apply_network_config', False)):
+ self._network_config = None
+ return self._network_config
+ if self.network_json == sources.UNSET:
+
+--- a/tests/unittests/test_datasource/test_openstack.py
++++ b/tests/unittests/test_datasource/test_openstack.py
+@@ -345,6 +345,7 @@ class TestOpenStackDataSource(test_helpers.HttprettyTestCase):
+ settings.CFG_BUILTIN, None, helpers.Paths({'run_dir': self.tmp}))
+ sample_json = {'links': [{'ethernet_mac_address': 'mymac'}],
+ 'networks': [], 'services': []}
++ ds_os.ds_cfg = {'apply_network_config': True} # Default is False
+ ds_os.network_json = sample_json
+ with test_helpers.mock.patch(mock_path) as m_convert_json:
+ m_convert_json.return_value = example_cfg
+
diff --git a/debian/patches/series b/debian/patches/series
index 7e909afc..d5a24c55 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
azure-use-walinux-agent.patch
ds-identify-behavior-xenial.patch
stable-release-no-jsonschema-dep.patch
+openstack-no-network-config.patch