diff options
| author | Dan Wendlandt <dan@nicira.com> | 2011-09-07 14:27:06 -0700 |
|---|---|---|
| committer | Dan Wendlandt <dan@nicira.com> | 2011-09-07 14:27:06 -0700 |
| commit | 0f5eb3f888de5f6eb23f968fa5a2270d2a350bcc (patch) | |
| tree | 0ee3f8a60147da042b0b14db350a320228876fa6 /bin | |
| parent | e5e3b306985a3b1fdd8a971f48b76eaf8f923f21 (diff) | |
| parent | 3e0698e3b57c9f73a359340f51c2797d8adc669a (diff) | |
| download | nova-0f5eb3f888de5f6eb23f968fa5a2270d2a350bcc.tar.gz nova-0f5eb3f888de5f6eb23f968fa5a2270d2a350bcc.tar.xz nova-0f5eb3f888de5f6eb23f968fa5a2270d2a350bcc.zip | |
merge trunk
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/instance-usage-audit | 5 | ||||
| -rwxr-xr-x | bin/nova-ajax-console-proxy | 12 | ||||
| -rwxr-xr-x | bin/nova-manage | 6 |
3 files changed, 11 insertions, 12 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() diff --git a/bin/nova-manage b/bin/nova-manage index 6dd2920d1..bc191b2f0 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -166,7 +166,7 @@ class VpnCommands(object): print address, print vpn['host'], print ec2utils.id_to_ec2_id(vpn['id']), - print vpn['state_description'], + print vpn['vm_state'], print state else: print None @@ -892,7 +892,7 @@ class VmCommands(object): instance['hostname'], instance['host'], instance['instance_type'].name, - instance['state_description'], + instance['vm_state'], instance['launched_at'], instance['image_ref'], instance['kernel_id'], @@ -1246,7 +1246,7 @@ class VsaCommands(object): type=vc['instance_type']['name'], fl_ip=floating_addr, fx_ip=fixed_addr, - stat=vc['state_description'], + stat=vc['vm_state'], host=vc['host'], time=str(vc['created_at'])) |
