From 4fb44e9d9e33953e383e4116f6d0a5c1906a08c0 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 24 Jun 2010 04:11:58 +0100 Subject: try to ping vpn instances --- bin/nova-manage | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index b1e984096..1b77ede46 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -47,8 +47,15 @@ class VpnCommands(object): vpn = self.__vpn_for(project.id) if vpn: + out, err = utils.execute("ping -c1 -w1 %s > /dev/null; echo $?", vpn['private_dns_name']) + if out.strip() == '0': + net = 'up' + else: + net = 'down' print vpn['instance_id'], - print vpn['state'] + print vpn['state_description'], + print net + else: print None @@ -56,7 +63,7 @@ class VpnCommands(object): for instance in self.instdir.all: if (instance.state.has_key('image_id') and instance['image_id'] == FLAGS.vpn_image_id - and not instance['state'] in ['shutting_down', 'shutdown'] + and not instance['state_description'] in ['shutting_down', 'shutdown'] and instance['project_id'] == project_id): return instance -- cgit