]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
scheduler: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)
authorJulien Fortin <julien@cumulusnetworks.com>
Thu, 17 Jan 2019 03:45:35 +0000 (11:45 +0800)
committerJulien Fortin <julien@cumulusnetworks.com>
Fri, 18 Jan 2019 07:52:59 +0000 (15:52 +0800)
ifupdown2 behaviour significantly diverges from ifupdown on debian stretch.
Original ifupdown uses run-parts which supposedly doesn't run non-executable
files in the directory. However, ifupdown2 doesn't seem to make this
distinction.
This patch will log warning EACCES exceptions (instead of log error) and exit 0

Reported-by: George Diamantopoulos <gedia>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian/changelog
ifupdown2/ifupdown/scheduler.py

index 0dfc055b24db076c90e257c17e9dd3cdc34e860e..6a079aa4a9344b9d839c18c4bdcf494147e458e3 100644 (file)
@@ -1,5 +1,6 @@
 ifupdown2 (1.2.5-1) unstable; urgency=medium
 
 ifupdown2 (1.2.5-1) unstable; urgency=medium
 
+  * Fix: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)
   * Fix: debian: install sysvinit script (closes: #918775)
   * Fix: debian: postinst: remove diversion after upgrade from stretch
          (closes: #919443)
   * Fix: debian: install sysvinit script (closes: #918775)
   * Fix: debian: postinst: remove diversion after upgrade from stretch
          (closes: #919443)
index a3f467a1d6311f05692532244c17408869ee3eee..940c4f13866baf48850712a4ebe07bfd90ae6f51 100644 (file)
@@ -7,6 +7,7 @@
 #    interface scheduler
 #
 
 #    interface scheduler
 #
 
+import os
 import sys
 
 from sets import Set
 import sys
 
 from sets import Set
@@ -132,7 +133,10 @@ class ifaceScheduler():
                 try:
                     utils.exec_command(mname, env=cenv)
                 except Exception, e:
                 try:
                     utils.exec_command(mname, env=cenv)
                 except Exception, e:
-                    ifupdownobj.log_error('%s: %s %s' % (ifacename, op, str(e)))
+                    if "permission denied" in str(e).lower():
+                        ifupdownobj.logger.warning('%s: %s %s' % (ifacename, op, str(e)))
+                    else:
+                        ifupdownobj.log_error('%s: %s %s' % (ifacename, op, str(e)))
 
     @classmethod
     def run_iface_list_ops(cls, ifupdownobj, ifaceobjs, ops):
 
     @classmethod
     def run_iface_list_ops(cls, ifupdownobj, ifaceobjs, ops):