mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
scheduler: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)
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>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
# interface scheduler
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from sets import Set
|
||||
@@ -132,7 +133,10 @@ class ifaceScheduler():
|
||||
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):
|
||||
|
Reference in New Issue
Block a user