diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-11-16 09:33:50 -0500 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-11-16 09:34:12 -0500 |
| commit | bc74440a177322bd425816058bfff901d4d84d12 (patch) | |
| tree | c7224fb879b95b6ddc741f677a49f9d2fbb60898 | |
| parent | 7ece1e7e607849f0d9a0eb5551899b3cc973545e (diff) | |
Remove hostname update() logic in compute.API
I recently added update logic which had a severely faulty
assumption. That assumption was that an instnace object was
always going to be passed to update(). Since that is not the
case we'll have to revisit this logic.
Change-Id: Ib2303d8719d2f3f8b5c123168864c97d64881544
| -rw-r--r-- | nova/compute/api.py | 11 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 1 | ||||
| -rw-r--r-- | nova/tests/test_compute.py | 14 |
3 files changed, 0 insertions, 26 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 0f3e0ae3d..ea59202e1 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -762,17 +762,6 @@ class API(base.Base): :returns: None """ - display_name = kwargs.get('display_name') - if display_name is None: - display_name = self._default_display_name(instance_id) - - hostname = kwargs.get('hostname') - if hostname is None: - hostname = display_name - - kwargs['display_name'] = display_name - kwargs['hostname'] = utils.sanitize_hostname(hostname) - rv = self.db.instance_update(context, instance_id, kwargs) return dict(rv.iteritems()) diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 7f7e079db..da17c1d69 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -1189,7 +1189,6 @@ class ServersControllerTest(test.TestCase): def server_update(context, id, params): filtered_dict = { 'display_name': 'server_test', - 'hostname': 'server-test', } self.assertEqual(params, filtered_dict) return filtered_dict diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py index 6b74a14f0..9a13d3057 100644 --- a/nova/tests/test_compute.py +++ b/nova/tests/test_compute.py @@ -1247,20 +1247,6 @@ class ComputeAPITestCase(BaseTestCase): self.assertEqual('test-host', instances[0]['hostname']) - def test_hostname_update(self): - """Ensure instance hostname is set during an update.""" - instance_id = self._create_instance({"display_name": "test host"}) - instance = db.instance_get(self.context, instance_id) - - expected_hostname = 'test-host' - actual = self.compute_api.update(self.context, - instance_id, - **dict(instance)) - - self.assertEqual(expected_hostname, actual['hostname']) - - db.instance_destroy(self.context, instance_id) - def test_set_admin_password(self): """Ensure instance can have its admin password set""" instance_id = self._create_instance() |
