diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-09-01 11:08:41 -0400 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-09-01 11:08:41 -0400 |
| commit | 9b3a6c8cda99290f0b7aff740faec0e8544aafe0 (patch) | |
| tree | 394ba57ffeca1f07303b1a0f261ca0742864524e /bin | |
| parent | 1c6d74a08dbb5b472e85e3d3a1fe2b3b8b9b89e3 (diff) | |
| parent | 17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2 (diff) | |
| download | nova-9b3a6c8cda99290f0b7aff740faec0e8544aafe0.tar.gz nova-9b3a6c8cda99290f0b7aff740faec0e8544aafe0.tar.xz nova-9b3a6c8cda99290f0b7aff740faec0e8544aafe0.zip | |
merging trunk
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/instance-usage-audit | 5 | ||||
| -rwxr-xr-x | bin/nova-ajax-console-proxy | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/bin/instance-usage-audit b/bin/instance-usage-audit index a06c6b1b3..7ce5732e7 100755 --- a/bin/instance-usage-audit +++ b/bin/instance-usage-audit @@ -102,9 +102,8 @@ if __name__ == '__main__': logging.setup() begin, end = time_period(FLAGS.instance_usage_audit_period) print "Creating usages for %s until %s" % (str(begin), str(end)) - instances = db.instance_get_active_by_window(context.get_admin_context(), - begin, - end) + ctxt = context.get_admin_context() + instances = db.instance_get_active_by_window_joined(ctxt, begin, end) print "%s instances" % len(instances) for instance_ref in instances: usage_info = utils.usage_from_instance(instance_ref, diff --git a/bin/nova-ajax-console-proxy b/bin/nova-ajax-console-proxy index 0a789b4b9..23fb42fb5 100755 --- a/bin/nova-ajax-console-proxy +++ b/bin/nova-ajax-console-proxy @@ -113,11 +113,10 @@ class AjaxConsoleProxy(object): AjaxConsoleProxy.tokens[kwargs['token']] = \ {'args': kwargs, 'last_activity': time.time()} - conn = rpc.create_connection(new=True) - consumer = rpc.create_consumer( - conn, - FLAGS.ajax_console_proxy_topic, - TopicProxy) + self.conn = rpc.create_connection(new=True) + self.conn.create_consumer( + FLAGS.ajax_console_proxy_topic, + TopicProxy) def delete_expired_tokens(): now = time.time() @@ -129,7 +128,7 @@ class AjaxConsoleProxy(object): for k in to_delete: del AjaxConsoleProxy.tokens[k] - utils.LoopingCall(consumer.fetch, enable_callbacks=True).start(0.1) + self.conn.consume_in_thread() utils.LoopingCall(delete_expired_tokens).start(1) if __name__ == '__main__': @@ -142,3 +141,4 @@ if __name__ == '__main__': server = wsgi.Server("AJAX Console Proxy", acp, port=acp_port) service.serve(server) service.wait() + self.conn.close() |
