summaryrefslogtreecommitdiff
path: root/debian/patches/ec2-dont-apply-full-imds-network-config.patch
blob: 148863220a3a5a239b97d103322c6bdbd2377a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Ec2, do not render full network from IMDS by default
 Retain default network config behavior on Ec2, which is dhcp on eth0.
 If datasource config option apply_full_imds_network_config is set True,
 full network config for all interfaces and secondary addresses described in
 IMDS.
Author: Chad Smith <chad.smith@canonical.com>
Origin: backport
Forwarded: not-needed
Last-Update: 2020-06-01
--- a/cloudinit/sources/DataSourceEc2.py
+++ b/cloudinit/sources/DataSourceEc2.py
@@ -506,12 +506,12 @@ class DataSourceEc2(sources.DataSource):
         if isinstance(net_md, dict):
             # SRU_BLOCKER: xenial, bionic and eoan should default
             # apply_full_imds_network_config to False to retain original
-            # behavior on those releases.
+            # behavior on those releases.  SRU_UPSTREAM_COMMIT: 6600c6
             result = convert_ec2_metadata_network_config(
                 net_md,
                 fallback_nic=iface,
                 full_network_config=util.get_cfg_option_bool(
-                    self.ds_cfg, "apply_full_imds_network_config", True
+                    self.ds_cfg, "apply_full_imds_network_config", False
                 ),
             )
 
--- a/tests/unittests/sources/test_ec2.py
+++ b/tests/unittests/sources/test_ec2.py
@@ -492,7 +492,14 @@ class TestEc2(test_helpers.ResponsesTest
         """
         ds = self._setup_ds(
             platform_data=self.valid_platform_data,
-            sys_cfg={"datasource": {"Ec2": {"strict_id": True}}},
+            sys_cfg={
+                "datasource": {
+                    "Ec2": {
+                        "strict_id": True,
+                        "apply_full_imds_network_config": True,
+                    }
+                }
+            },
             md={"md": SECONDARY_IP_METADATA_2018_09_24},
         )
         find_fallback_path = M_PATH_NET + "find_fallback_nic"