SpriteLink/NIPAP — Issue #142: search_schema with empty query raises exception
Author: garberg
Created: 2012-02-17 16:03:18+00:00
State: open

When trying to use the search_schema function with an empty query dict raises an error. The expected behavior is to return all schemas.

```
2012-02-17 16:56:01,896: ERROR Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/twisted/web/http.py", line 807, in requestReceived
self.process()
File "/usr/lib/python2.6/dist-packages/twisted/web/server.py", line 125, in process
self.render(resrc)
File "/usr/lib/python2.6/dist-packages/twisted/web/server.py", line 132, in render
body = resrc.render(self)
File "/usr/lib/python2.6/dist-packages/nipap/xmlrpc.py", line 209, in render
defer.maybeDeferred(function, *args).addErrback(
--- ---
File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 125, in maybeDeferred
result = f(*args, **kw)
File "/usr/lib/python2.6/dist-packages/nipap/xmlrpc.py", line 336, in xmlrpc_search_schema
return self.nipap.search_schema(args.get('auth'), args.get('query'), args.get('search_options'))
File "/usr/lib/python2.6/dist-packages/nipap/nipap.py", line 863, in search_schema
where, opt = self._expand_schema_query(query)
File "/usr/lib/python2.6/dist-packages/nipap/nipap.py", line 540, in _expand_schema_query
if type(query['val1']) == dict and type(query['val2']) == dict:
exceptions.KeyError: 'val1'

```