]> git.proxmox.com Git - mirror_ifupdown2.git/blobdiff - ifupdown/scheduler.py
Fix a few minor ifquery check failures
[mirror_ifupdown2.git] / ifupdown / scheduler.py
index 5c13d4ab840dbad9dec33127f962e17c4e0023e5..1d84a803d43fd06d248462a55b54858cb7c929b6 100644 (file)
@@ -53,6 +53,13 @@ class ifaceScheduler():
         if not ifupdownobj.ADDONS_ENABLE: return
         if op == 'query-checkcurr':
             query_ifaceobj=ifupdownobj.create_n_save_ifaceobjcurr(ifaceobj)
+            # If not type bridge vlan and the object does not exist,
+            # mark not found and return
+            if (not ifupdownobj.link_exists(ifaceobj.name) and
+                ifaceobj.type != ifaceType.BRIDGE_VLAN):
+                query_ifaceobj.set_state_n_status(ifaceState.from_str(op),
+                                                  ifaceStatus.NOTFOUND)
+                return
         for mname in ifupdownobj.module_ops.get(op):
             m = ifupdownobj.modules.get(mname)
             err = 0
@@ -104,7 +111,8 @@ class ifaceScheduler():
         # if interface exists in the system
         ifacename = ifaceobjs[0].name
         ifupdownobj.logger.info('%s: running ops ...' %ifacename)
-        if ('down' in ops[0] and ifaceobjs[0].type != ifaceType.BRIDGE_VLAN and
+        if ('down' in ops[0] and
+                ifaceobjs[0].type != ifaceType.BRIDGE_VLAN and
                 not ifupdownobj.link_exists(ifacename)):
             ifupdownobj.logger.debug('%s: does not exist' %ifacename)
             # run posthook before you get out of here, so that