diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-10-02 01:16:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-10-02 01:16:08 +0000 |
| commit | 659d4d5175fc857b1873edbc55cbf04eadc301b8 (patch) | |
| tree | 57b9592d37a0e1b89424a5af150015826be0b87d /nova/virt | |
| parent | 771458f724a4ff1172b6b1a72d8b727fa07b94be (diff) | |
| parent | 625996722f08b57b2926cf4d6aff5fe03abc196c (diff) | |
Merge "remove deprecated connection_type flag"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/connection.py | 84 |
1 files changed, 0 insertions, 84 deletions
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) |
