From d0c71fbc8693298971de726447dea47dc2cefd18 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 18 Jan 2016 12:27:48 +0000 Subject: [PATCH] target: warn if a module is not supported for the target When you create a target using devlib, you may not set load_default_modules because you want to load a specific list of modules. In that case, raise a warning if one of those modules failed to load, as it is something you are not expecting. In the general case, the standard set of modules are tried to be loaded. We know that they are not supported for all platforms so just emit a debug message. --- devlib/target.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 3fb25fc..e744110 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -429,7 +429,11 @@ class Target(object): if mod.probe(self): self._install_module(mod, **params) else: - self.logger.debug('Module {} is not supported by the target'.format(mod.name)) + msg = 'Module {} is not supported by the target'.format(mod.name) + if self.load_default_modules: + self.logger.debug(msg) + else: + self.logger.warning(msg) def _install_module(self, mod, **params): if mod.name not in self._installed_modules: