From 66ed706a2f7ee8a6b4703de988b4d7ef0826fc2a Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 2 Sep 2010 23:13:12 -0700 Subject: removed model from nova-manage --- bin/nova-manage | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 7f20531dc..055f2c3a9 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -25,10 +25,10 @@ import sys import time +from nova import db from nova import flags from nova import utils from nova.auth import manager -from nova.compute import model from nova.cloudpipe import pipelib from nova.endpoint import cloud @@ -41,7 +41,6 @@ class VpnCommands(object): def __init__(self): self.manager = manager.AuthManager() - self.instdir = model.InstanceDirectory() self.pipe = pipelib.CloudPipe(cloud.CloudController()) def list(self): @@ -73,9 +72,8 @@ class VpnCommands(object): def _vpn_for(self, project_id): """Get the VPN instance for a project ID.""" - for instance in self.instdir.all: - if ('image_id' in instance.state - and instance['image_id'] == FLAGS.vpn_image_id + for instance in db.instance_get_all(): + if (instance['image_id'] == FLAGS.vpn_image_id and not instance['state_description'] in ['shutting_down', 'shutdown'] and instance['project_id'] == project_id): -- cgit