From 39a46f48bfcaae1ca4500ba145c1c08c6bf009f1 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 8 Jan 2013 08:13:12 +0000 Subject: Move vpn_image_id to pipelib Apart from checking whether a given image is the cloudpipe image, the vpn_image_id option is only used within pipelib itself. Add a is_vpn_image() helper method and move the option into pipelib. Some rejiggering of how pipelib imports ec2 opts is required to avoid circular imports. blueprint: scope-config-opts Change-Id: Ie984b2bb81681c24d3cee803082960083992a535 --- nova/compute/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 5627687fc..dc8dd843a 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -42,6 +42,7 @@ import uuid from eventlet import greenthread from nova import block_device +from nova.cloudpipe import pipelib from nova import compute from nova.compute import instance_types from nova.compute import power_state @@ -177,7 +178,6 @@ CONF.import_opt('host', 'nova.config') CONF.import_opt('my_ip', 'nova.config') CONF.import_opt('network_manager', 'nova.service') CONF.import_opt('reclaim_instance_interval', 'nova.config') -CONF.import_opt('vpn_image_id', 'nova.config') CONF.import_opt('my_ip', 'nova.config') QUOTAS = quota.QUOTAS @@ -938,7 +938,7 @@ class ComputeManager(manager.SchedulerDependentManager): vm_state=vm_states.BUILDING, task_state=task_states.NETWORKING, expected_task_state=None) - is_vpn = instance['image_ref'] == str(CONF.vpn_image_id) + is_vpn = pipelib.is_vpn_image(instance['image_ref']) try: # allocate and get network info network_info = self.network_api.allocate_for_instance( -- cgit