From 625996722f08b57b2926cf4d6aff5fe03abc196c Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 1 Oct 2012 11:44:55 -0400 Subject: remove deprecated connection_type flag Fixes bug #1025712 connection_type was deprecated in Folsom and should now be removed in Grizzly as early as possible to shake out any fallout. This removes all references to it, changes the config sample and tests appropriately. Remove old default fixtures for flavors that specify ephemeral disks if the connection_type flag was set to 'libvirt' Change-Id: I8af831600a1931ae92c6d06c5105bd1bd81debe3 --- nova/virt/connection.py | 84 ------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 nova/virt/connection.py (limited to 'nova/virt') diff --git a/nova/virt/connection.py b/nova/virt/connection.py deleted file mode 100644 index 884bbb974..000000000 --- a/nova/virt/connection.py +++ /dev/null @@ -1,84 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# Copyright (c) 2010 Citrix Systems, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""Abstraction of the underlying virtualization API.""" - -import sys - -from nova.common import deprecated -from nova import exception -from nova import flags -from nova.openstack.common import importutils -from nova.openstack.common import log as logging -from nova import utils -from nova.virt import driver - -LOG = logging.getLogger(__name__) -FLAGS = flags.FLAGS - -known_drivers = { - 'baremetal': 'baremetal.BareMetalDriver', - 'fake': 'fake.FakeDriver', - 'libvirt': 'libvirt.LibvirtDriver', - 'vmwareapi': 'vmwareapi.VMWareESXDriver', - 'xenapi': 'xenapi.XenAPIDriver' - } - - -def get_connection(read_only=False): - """ - Returns an object representing the connection to a virtualization - platform, or to an on-demand bare-metal provisioning platform. - - This could be :mod:`nova.virt.fake.FakeConnection` in test mode, - a connection to KVM, QEMU, or UML via :mod:`libvirt_conn`, or a connection - to XenServer or Xen Cloud Platform via :mod:`xenapi`. Other platforms are - also supported. - - Any object returned here must conform to the interface documented by - :mod:`FakeConnection`. - - **Related flags** - - :connection_type: A string literal that falls through an if/elif structure - to determine what virtualization mechanism to use. - Values may be - - * fake - * libvirt - * xenapi - * vmwareapi - * baremetal - - """ - deprecated.warn(_('Specifying virt driver via connection_type is ' - 'deprecated. Use compute_driver=classname instead.')) - - driver_name = known_drivers.get(FLAGS.connection_type) - - if driver_name is None: - raise exception.VirtDriverNotFound(name=FLAGS.connection_type) - - conn = importutils.import_object_ns('nova.virt', driver_name, - read_only=read_only) - - if conn is None: - LOG.error(_('Failed to open connection to underlying virt platform')) - sys.exit(1) - return utils.check_isinstance(conn, driver.ComputeDriver) -- cgit