Optimize rapi
authorMichael Hanselmann <hansmi@google.com>
Wed, 14 May 2008 11:52:18 +0000 (11:52 +0000)
committerMichael Hanselmann <hansmi@google.com>
Wed, 14 May 2008 11:52:18 +0000 (11:52 +0000)
commit7defd89f9c2552a5cb922a1099ed984c5b122fab
treead7b8583dfbe8b34cc342d40a8fc7b44b3f7f914
parent3b0a97cd416332e1538114f38893bab86b6f5a00
Optimize rapi

A lot of changes:
- Don't use eval() anymore, it's evil
- Don't compile Regex' on every request, but once when resources.py is
  imported
- Use string comparison for URIs if possible
- Cleanup function used to parse requests (getController)
- Don't put class names as strings, but rather use classes directly
- Change unit tests accordingly
- Sort result of R_root._get to make unit tests reliable

Reviewed-by: amishchenko
lib/rapi/RESTHTTPServer.py
lib/rapi/resources.py
test/ganeti.rapi.resources_unittest.py