summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorroot <root@ubuntu>2010-12-15 11:23:33 -0800
committerroot <root@ubuntu>2010-12-15 11:23:33 -0800
commitdd4ee43cc2042299ed7a56b4690999fa1df120a1 (patch)
treea168cb90ee2131532a4b9ff8b8b232f20660a2ee /nova/api
parentb0279030127b7fe8df21db12a8727ea623ca46e2 (diff)
clean up tests and add overriden time method to utils
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/__init__.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py
index 381b0e871..5ae15f2ae 100644
--- a/nova/api/ec2/__init__.py
+++ b/nova/api/ec2/__init__.py
@@ -79,15 +79,14 @@ class Lockout(wsgi.Middleware):
sneak in before the lockout hits, but this is extremely rare and would
only result in a couple of extra failed attempts."""
- def __init__(self, application, time_fn=None):
- """middleware can pass a custom time function to fake for testing."""
+ def __init__(self, application):
+ """middleware can use fake for testing."""
if FLAGS.lockout_memcached_servers:
import memcache
- self.mc = memcache.Client(FLAGS.lockout_memcached_servers,
- debug=0)
else:
- from nova import fakememcache
- self.mc = fakememcache.Client(time_fn=time_fn)
+ from nova import fakememcache as memcache
+ self.mc = memcache.Client(FLAGS.lockout_memcached_servers,
+ debug=0)
super(Lockout, self).__init__(application)
@webob.dec.wsgify