From 6758775546266d0c01931d2229a7a10c74089a9f Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Mon, 28 Jan 2013 16:21:12 +0100 Subject: [PATCH] units manager: handle NotSupportedPluginException --- tuned/plugins/exceptions.py | 4 ++++ tuned/units/manager.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 tuned/plugins/exceptions.py diff --git a/tuned/plugins/exceptions.py b/tuned/plugins/exceptions.py new file mode 100644 index 0000000..5b5fe97 --- /dev/null +++ b/tuned/plugins/exceptions.py @@ -0,0 +1,4 @@ +import tuned.exceptions + +class NotSupportedPluginException(tuned.exceptions.TunedException): + pass diff --git a/tuned/units/manager.py b/tuned/units/manager.py index 2623c30..edf6e8f 100644 --- a/tuned/units/manager.py +++ b/tuned/units/manager.py @@ -1,5 +1,6 @@ import tuned.exceptions import tuned.logs +import tuned.plugins.exceptions log = tuned.logs.get() @@ -43,9 +44,9 @@ class Manager(object): try: plugin = self._plugins_repository.create(plugin_name) self._plugins.append(plugin) - #except NotSupportedPlugin: - # log.info("skipping plugin '%s', not supported on your system" % plugin_name) - # continue + except tuned.plugins.exceptions.NotSupportedPluginException: + log.info("skipping plugin '%s', not supported on your system" % plugin_name) + continue except Exception as e: log.error("failed to initialize plugin %s" % plugin_name) log.exception(e)