]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: vrf: change warn to error if vrf master is not configured
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Thu, 11 Aug 2016 23:20:16 +0000 (16:20 -0700)
committerNikhil <nikhil@cumulusnetworks.com>
Wed, 24 Aug 2016 17:19:54 +0000 (10:19 -0700)
Ticket: CM-12360
Reviewed By: julien, nikhil
Testing Done: tested vrf slaves without master

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
addons/vrf.py

index b35866c2aec64fcfefb6d17eaedf7f56c669dd93..7d20becf40635fc432253d6c0f21d3419e972f6b 100644 (file)
@@ -374,8 +374,13 @@ class vrf(moduleBase):
             elif ifaceobj:
                 vrf_master_objs = ifaceobj_getfunc(vrfname)
                 if not vrf_master_objs:
-                    self.logger.warn('%s: vrf master ifaceobj not found'
-                                     %ifacename)
+                    # this is the case where vrf is assigned to an interface
+                    # but user has not provided a vrf interface.
+                    # people expect you to warn them but go ahead with the
+                    # rest of the config on that interface
+                    netlink.link_set_updown(ifacename, "up")
+                    self.log_error('vrf master ifaceobj %s not found'
+                                   %vrfname)
                     return
                 if (ifupdownflags.flags.ALL or
                     (ifupdownflags.flags.CLASS and