1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Fix 'source' file error handling

Ticket:
Reviewed By:
Testing Done:
This commit is contained in:
Roopa Prabhu
2014-11-19 17:48:02 -08:00
parent 16d854b461
commit 2b5635d457

View File

@ -141,7 +141,12 @@ class networkInterfaces():
self.logger.debug('processing sourced line ..\'%s\'' %lines[cur_idx])
sourced_file = re.split(self._ws_split_regex, lines[cur_idx], 2)[1]
if sourced_file:
for f in glob.glob(sourced_file):
filenames = glob.glob(sourced_file)
if not filenames:
self._parse_error(self._currentfile, lineno,
'cannot find source file %s' %sourced_file)
return 0
for f in filenames:
self.read_file(f)
else:
self._parse_error(self._currentfile, lineno,