sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
20a859
From 0dab936fd1332749f905a20a44003f441eb76783 Mon Sep 17 00:00:00 2001
20a859
From: Lars Kellogg-Stedman <lars@redhat.com>
20a859
Date: Thu, 16 Feb 2017 15:09:51 -0500
20a859
Subject: [PATCH] correct errors in cloudinit/net/sysconfig.py
20a859
20a859
There were some logic errors in sysconfig.py that appear to be the
20a859
result of accidentally typing "iface" where it should have been
20a859
"iface_cfg".  This patch corrects those problems so that the module
20a859
can run successfully.
20a859
20a859
LP: #1665441
20a859
Resolves: rhbz#1389530
20a859
(cherry picked from commit 07ef7f29c5ce9a97939eb32ca80fc1d8c2609216)
20a859
---
20a859
 cloudinit/net/sysconfig.py | 4 ++--
20a859
 1 file changed, 2 insertions(+), 2 deletions(-)
20a859
20a859
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
20a859
index 3c9f2d2..0b5f13c 100644
20a859
--- a/cloudinit/net/sysconfig.py
20a859
+++ b/cloudinit/net/sysconfig.py
20a859
@@ -282,10 +282,10 @@ class Renderer(renderer.Renderer):
20a859
                 cls._render_subnet(iface_cfg, route_cfg, iface_subnets[0])
20a859
             elif len(iface_subnets) > 1:
20a859
                 for i, iface_subnet in enumerate(iface_subnets,
20a859
-                                                 start=len(iface.children)):
20a859
+                                                 start=len(iface_cfg.children)):
20a859
                     iface_sub_cfg = iface_cfg.copy()
20a859
                     iface_sub_cfg.name = "%s:%s" % (iface_name, i)
20a859
-                    iface.children.append(iface_sub_cfg)
20a859
+                    iface_cfg.children.append(iface_sub_cfg)
20a859
                     cls._render_subnet(iface_sub_cfg, route_cfg, iface_subnet)
20a859
 
20a859
     @classmethod