From 3980661f165abcbeead22781bcf3955d6de00c17 Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Wed, 10 Dec 2014 21:30:39 -0800 Subject: [PATCH] Add a few more trt/except blocks to warn and proceed Ticket: Reviewed By: Testing Done: --- ifupdown/scheduler.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ifupdown/scheduler.py b/ifupdown/scheduler.py index 247bb76..f50f99f 100644 --- a/ifupdown/scheduler.py +++ b/ifupdown/scheduler.py @@ -138,7 +138,11 @@ class ifaceScheduler(): if (not ifaceobjs[0].addr_method or (ifaceobjs[0].addr_method and ifaceobjs[0].addr_method != 'manual')): - handler(ifupdownobj, ifaceobjs[0]) + try: + handler(ifupdownobj, ifaceobjs[0]) + except Exception, e: + ifupdownobj.logger.warn('%s' %str(e)) + pass for ifaceobj in ifaceobjs: cls.run_iface_op(ifupdownobj, ifaceobj, op, cenv=ifupdownobj.generate_running_env(ifaceobj, op) @@ -146,8 +150,12 @@ class ifaceScheduler(): '0') == '1' else None) posthookfunc = ifupdownobj.sched_hooks.get('posthook') if posthookfunc: - [posthookfunc(ifupdownobj, ifaceobj, ops[0]) - for ifaceobj in ifaceobjs] + try: + [posthookfunc(ifupdownobj, ifaceobj, ops[0]) + for ifaceobj in ifaceobjs] + except Exception, e: + ifupdownobj.logger.warn('%s' %str(e)) + pass @classmethod def _check_upperifaces(cls, ifupdownobj, ifaceobj, ops, parent,