summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Dague <sdague@linux.vnet.ibm.com>2012-07-06 10:30:04 -0400
committerSean Dague <sdague@linux.vnet.ibm.com>2012-07-10 11:43:18 -0400
commit442beb76e23bc30bac953fc1b21d06d3bd18351d (patch)
treef0463aab45651bebed301fff3db3d07bc9e51e7a
parent5dd9e6150c0bebaef53e23fff7e55a17ef694537 (diff)
downloadnova-442beb76e23bc30bac953fc1b21d06d3bd18351d.tar.gz
nova-442beb76e23bc30bac953fc1b21d06d3bd18351d.tar.xz
nova-442beb76e23bc30bac953fc1b21d06d3bd18351d.zip
refactor baremetal/proxy => baremetal/driver
Part of bp:virt-driver-cleanup Make the baremetal driver consistent in naming as a driver instead of a proxy / connection. Change-Id: I75d7d90bd8139842b588f1fafb1267511f29a1fb
-rw-r--r--nova/tests/baremetal/test_proxy_bare_metal.py8
-rw-r--r--nova/virt/baremetal/__init__.py3
-rw-r--r--nova/virt/baremetal/driver.py (renamed from nova/virt/baremetal/proxy.py)4
-rw-r--r--nova/virt/connection.py2
4 files changed, 10 insertions, 7 deletions
diff --git a/nova/tests/baremetal/test_proxy_bare_metal.py b/nova/tests/baremetal/test_proxy_bare_metal.py
index b835c103e..4fe6722c3 100644
--- a/nova/tests/baremetal/test_proxy_bare_metal.py
+++ b/nova/tests/baremetal/test_proxy_bare_metal.py
@@ -27,7 +27,7 @@ from nova import test
from nova.tests import fake_utils
from nova.virt.baremetal import dom
-from nova.virt.baremetal import proxy
+from nova.virt.baremetal import driver
FLAGS = flags.FLAGS
@@ -226,7 +226,7 @@ class BareMetalDomTestCase(test.TestCase):
self.assertEquals(bmdom.find_domain('instance-00000001'), domain)
-class ProxyBareMetalTestCase(test.TestCase):
+class BareMetalTestCase(test.TestCase):
test_ip = '10.11.12.13'
test_instance = {'memory_kb': '1024000',
@@ -240,7 +240,7 @@ class ProxyBareMetalTestCase(test.TestCase):
'instance_type_id': '5'} # m1.small
def setUp(self):
- super(ProxyBareMetalTestCase, self).setUp()
+ super(BareMetalTestCase, self).setUp()
self.flags(baremetal_driver='fake')
fake_utils.stub_out_utils_execute(self.stubs)
@@ -257,7 +257,7 @@ class ProxyBareMetalTestCase(test.TestCase):
self.mox.ReplayAll()
# Code under test
- conn = proxy.ProxyConnection(True)
+ conn = driver.BareMetalDriver(True)
# TODO(mikalstill): this is not a very good fake instance
info = conn.get_info({'name': 'instance-00000001'})
diff --git a/nova/virt/baremetal/__init__.py b/nova/virt/baremetal/__init__.py
index efe07d0df..520feecbd 100644
--- a/nova/virt/baremetal/__init__.py
+++ b/nova/virt/baremetal/__init__.py
@@ -13,3 +13,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+
+# NOTE(sdague) for more convenient compute_driver names
+from nova.virt.baremetal.driver import BareMetalDriver
diff --git a/nova/virt/baremetal/proxy.py b/nova/virt/baremetal/driver.py
index 56ed12715..50e1529c1 100644
--- a/nova/virt/baremetal/proxy.py
+++ b/nova/virt/baremetal/driver.py
@@ -74,13 +74,13 @@ def _late_load_cheetah():
Template = t.Template
-class ProxyConnection(driver.ComputeDriver):
+class BareMetalDriver(driver.ComputeDriver):
def __init__(self, read_only):
_late_load_cheetah()
# Note that baremetal doesn't have a read-only connection
# mode, so the read_only parameter is ignored
- super(ProxyConnection, self).__init__()
+ super(BareMetalDriver, self).__init__()
self.baremetal_nodes = nodes.get_baremetal_nodes()
self._wrapped_conn = None
self._host_state = None
diff --git a/nova/virt/connection.py b/nova/virt/connection.py
index f4a978d17..884bbb974 100644
--- a/nova/virt/connection.py
+++ b/nova/virt/connection.py
@@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
known_drivers = {
- 'baremetal': 'baremetal.proxy.ProxyConnection',
+ 'baremetal': 'baremetal.BareMetalDriver',
'fake': 'fake.FakeDriver',
'libvirt': 'libvirt.LibvirtDriver',
'vmwareapi': 'vmwareapi.VMWareESXDriver',