Commits

Michał Górny  committed 49c679e

Support bootloader's .def_path being a list.

  • Participants
  • Parent commits 912daf1

Comments (0)

Files changed (1)

File ecleankernel/bootloader/lilo.py

 		self._debug = debug
 		self._kernel_re = re.compile(self.kernel_re,
 				re.MULTILINE | re.IGNORECASE)
-		self.path = path or self.def_path
-
-		try:
-			with open(self.path) as f:
-				debug.print('%s found' % self.path)
-				self._content = f.read()
-		except IOError as e:
-			if e.errno != errno.ENOENT:
-				raise
-			else:
-				raise BootloaderNotFound()
+		paths = path or self.def_path
+		if not isinstance(paths, tuple):
+			paths = (paths,)
+
+		for p in paths:
+			try:
+				with open(p) as f:
+					debug.print('%s found' % p)
+					self.path = p
+					self._content = f.read()
+			except IOError as e:
+				if e.errno != errno.ENOENT:
+					raise
+		else:
+			raise BootloaderNotFound()
 
 	def _get_kernels(self, content):
 		debug = self._debug