Laszlo Hornyak has uploaded a new change for review.

Change subject: throw exception if plugin not found
......................................................................

throw exception if plugin not found

if a plugin is not found, throw an exception rather than ignoring it

Change-Id: Iffa60c3a1e900465f41dc003263cd1e4d235ee9e
Bug-Url: https://bugzilla.redhat.com/1002443
Signed-off-by: Laszlo Hornyak <lhorn...@redhat.com>
---
M src/ovirtscheduler/request_handler.py
M tests/java/src/test/java/org/ovirt/schedulerproxy/SchedulerProxyTest.java
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-scheduler-proxy 
refs/changes/28/18728/1

diff --git a/src/ovirtscheduler/request_handler.py 
b/src/ovirtscheduler/request_handler.py
index 55d117b..6da5aa7 100644
--- a/src/ovirtscheduler/request_handler.py
+++ b/src/ovirtscheduler/request_handler.py
@@ -133,7 +133,7 @@
             if f not in self._filters:
                 logging.warning("run_filters::Filter requested but "
                                 "+ was not found: " + f)
-                continue
+                raise RuntimeError("plugin not found: "+f)
             runner = PythonMethodRunner(
                 self._pluginDir,
                 f,
diff --git 
a/tests/java/src/test/java/org/ovirt/schedulerproxy/SchedulerProxyTest.java 
b/tests/java/src/test/java/org/ovirt/schedulerproxy/SchedulerProxyTest.java
index bbf911a..2f2a81c 100644
--- a/tests/java/src/test/java/org/ovirt/schedulerproxy/SchedulerProxyTest.java
+++ b/tests/java/src/test/java/org/ovirt/schedulerproxy/SchedulerProxyTest.java
@@ -51,6 +51,11 @@
         assertTrue(result.contains(HOST_ID2));
     }
 
+    @Test(expected = XmlRpcException.class)
+    public void testFilterWithNotExistingPLugin() throws XmlRpcException {
+        proxy.filter(new String[] { "NOTEXISTINGPLUGIN-" + 
System.currentTimeMillis() }, HOST_ARRAY, VM_ID, "");
+    }
+
     @Test
     public void testScore() throws XmlRpcException {
         HashMap<String, Integer> result =


-- 
To view, visit http://gerrit.ovirt.org/18728
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffa60c3a1e900465f41dc003263cd1e4d235ee9e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-scheduler-proxy
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhorn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to