Ubuntu Pastebin

Paste from nturner at Fri, 1 Jul 2016 17:26:22 +0000

Download as text
 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index 63e54f9..6709459 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -252,7 +252,7 @@ def _rename_interfaces(renames, strict_present=True, strict_busy=True,
         cur_bymac[mac] = cur

     def update_byname(bymac):
-        return {data['name']: data for data in bymac.values()}
+        return dict([(data['name'], data) for data in bymac.values()])

     def rename(cur, new):
         util.subp(["ip", "link", "set", cur, "name", new], capture=True)
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py
index 08bc132..6c4cbdd 100644
--- a/cloudinit/sources/DataSourceSmartOS.py
+++ b/cloudinit/sources/DataSourceSmartOS.py
@@ -718,8 +718,8 @@ def convert_smartos_network_data(network_data=None):

     config = []
     for nic in network_data:
-        cfg = {k: v for k, v in nic.items()
-               if k in valid_keys['physical']}
+        cfg = dict([(k, v) for k, v in nic.items()
+                    if k in valid_keys['physical']])
         cfg.update({
             'type': 'physical',
             'name': nic['interface']})
@@ -728,8 +728,8 @@ def convert_smartos_network_data(network_data=None):

         subnets = []
         for ip, gw in zip(nic['ips'], nic['gateways']):
-            subnet = {k: v for k, v in nic.items()
-                      if k in valid_keys['subnet']}
+            subnet = dict([(k, v) for k, v in nic.items()
+                           if k in valid_keys['subnet']])
             subnet.update({
                 'type': 'static',
                 'address': ip,
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index d52cb56..d65a92b 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -542,8 +542,8 @@ def convert_net_json(network_json=None, known_macs=None):
     config = []
     for link in links:
         subnets = []
-        cfg = {k: v for k, v in link.items()
-               if k in valid_keys['physical']}
+        cfg = dict([(k, v) for k, v in link.items()
+                    if k in valid_keys['physical']])
         # 'name' is not in openstack spec yet, but we will support it if it is
         # present.  The 'id' in the spec is currently implemented as the host
         # nic's name, meaning something like 'tap-adfasdffd'.  We do not want
@@ -553,8 +553,8 @@ def convert_net_json(network_json=None, known_macs=None):

         for network in [n for n in networks
                         if n['link'] == link['id']]:
-            subnet = {k: v for k, v in network.items()
-                      if k in valid_keys['subnet']}
+            subnet = dict([(k, v) for k, v in network.items()
+                           if k in valid_keys['subnet']])
             if 'dhcp' in network['type']:
                 t = 'dhcp6' if network['type'].startswith('ipv6') else 'dhcp4'
                 subnet.update({
Download as text