From: Roopa Prabhu Date: Fri, 21 Nov 2014 19:07:11 +0000 (-0800) Subject: Change "source" inclusion errors to warns. X-Git-Tag: 1.2.2-1~146^2~395 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=aa5751ba27c4ff15d27a0c8538ff5bf389de12db;p=mirror_ifupdown2.git Change "source" inclusion errors to warns. Ticket: CM-3346 Reviewed By: Testing Done: tested sanity --- diff --git a/ifupdown/networkinterfaces.py b/ifupdown/networkinterfaces.py index d2ec8e7..00ab548 100644 --- a/ifupdown/networkinterfaces.py +++ b/ifupdown/networkinterfaces.py @@ -77,6 +77,12 @@ class networkInterfaces(): else: self.logger.error('%s: line%d: %s' %(filename, lineno, msg)) + def _parse_warn(self, filename, lineno, msg): + if lineno == -1 or self._currentfile_has_template: + self.logger.warn('%s: %s' %(filename, msg)) + else: + self.logger.warn('%s: line%d: %s' %(filename, lineno, msg)) + def _validate_addr_family(self, ifaceobj, lineno=-1): if ifaceobj.addr_family: if not self._addrfams.get(ifaceobj.addr_family): @@ -143,7 +149,7 @@ class networkInterfaces(): if sourced_file: filenames = glob.glob(sourced_file) if not filenames: - self._parse_error(self._currentfile, lineno, + self._parse_warn(self._currentfile, lineno, 'cannot find source file %s' %sourced_file) return 0 for f in filenames: