From 058ea40e7b7fb2181a2058e6118dce3f051e1ff3 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Fri, 4 Oct 2013 00:54:40 -0700 Subject: [PATCH] VMware: remove deprecated configuration variable Removes support for vnc_password configuration variable. Closes-bug: #1235118 Change-Id: I70fd7d3ee06040d6ce49d93a4becd9cbfdd71f78 --- etc/nova/nova.conf.sample | 6 ----- nova/tests/virt/vmwareapi/test_vmwareapi.py | 4 ---- .../virt/vmwareapi/test_vmwareapi_vm_util.py | 23 +++---------------- nova/virt/vmwareapi/driver.py | 9 -------- nova/virt/vmwareapi/vm_util.py | 11 +-------- nova/virt/vmwareapi/vmops.py | 7 +++--- 6 files changed, 7 insertions(+), 53 deletions(-) diff --git a/etc/nova/nova.conf.sample b/etc/nova/nova.conf.sample index b0185df117ff..9af100b37064 100644 --- a/etc/nova/nova.conf.sample +++ b/etc/nova/nova.conf.sample @@ -3287,12 +3287,6 @@ # Total number of VNC ports (integer value) #vnc_port_total=10000 -# DEPRECATED. VNC password. The password-based access to VNC -# consoles will be removed in the next release. The default -# value will disable password protection on the VNC console. -# (string value) -#vnc_password= - # Whether to use linked clone (boolean value) #use_linked_clone=true diff --git a/nova/tests/virt/vmwareapi/test_vmwareapi.py b/nova/tests/virt/vmwareapi/test_vmwareapi.py index b027364d4d78..ba6139049a20 100644 --- a/nova/tests/virt/vmwareapi/test_vmwareapi.py +++ b/nova/tests/virt/vmwareapi/test_vmwareapi.py @@ -772,10 +772,6 @@ class VMwareAPIVMTestCase(test.NoDBTestCase): def test_get_vnc_console(self): self._test_get_vnc_console() - def test_get_vnc_console_with_password(self): - self.flags(vnc_password='vmware', group='vmware') - self._test_get_vnc_console() - def test_host_ip_addr(self): self.assertEquals(self.conn.get_host_ip_addr(), "test_url") diff --git a/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py b/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py index 614d13de42cb..0412c0f58978 100644 --- a/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py +++ b/nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py @@ -298,14 +298,14 @@ class VMwareVMUtilTestCase(test.NoDBTestCase): vmdk_adapter_type = vm_util.get_vmdk_adapter_type("dummyAdapter") self.assertEqual("dummyAdapter", vmdk_adapter_type) - def _test_get_vnc_config_spec(self, port, password): + def _test_get_vnc_config_spec(self, port): result = vm_util.get_vnc_config_spec(fake.FakeFactory(), - port, password) + port) return result def test_get_vnc_config_spec(self): - result = self._test_get_vnc_config_spec(7, None) + result = self._test_get_vnc_config_spec(7) expected = """{'extraConfig': [ {'value': 'true', 'key': 'RemoteDisplay.vnc.enabled', @@ -318,23 +318,6 @@ class VMwareVMUtilTestCase(test.NoDBTestCase): result = re.sub(r'\s+', '', repr(result)) self.assertEqual(expected, result) - def test_get_vnc_config_spec_password(self): - result = self._test_get_vnc_config_spec(7, 'password') - expected = """{'extraConfig': [ - {'value': 'true', - 'key': 'RemoteDisplay.vnc.enabled', - 'obj_name': 'ns0:OptionValue'}, - {'value': 7, - 'key': 'RemoteDisplay.vnc.port', - 'obj_name': 'ns0:OptionValue'}, - {'value':'password', - 'key':'RemoteDisplay.vnc.password', - 'obj_name':'ns0:OptionValue'}], - 'obj_name': 'ns0:VirtualMachineConfigSpec'}""" - expected = re.sub(r'\s+', '', expected) - result = re.sub(r'\s+', '', repr(result)) - self.assertEqual(expected, result) - def test_get_all_cluster_refs_by_name_none(self): fake_objects = fake.FakeRetrieveResult() refs = vm_util.get_all_cluster_refs_by_name(fake_session(fake_objects), diff --git a/nova/virt/vmwareapi/driver.py b/nova/virt/vmwareapi/driver.py index ed2c01757e5a..5702cde626b8 100644 --- a/nova/virt/vmwareapi/driver.py +++ b/nova/virt/vmwareapi/driver.py @@ -99,15 +99,6 @@ vmwareapi_opts = [ deprecated_name='vnc_port_total', deprecated_group='DEFAULT', help='Total number of VNC ports'), - # Deprecated, remove in Icehouse - cfg.StrOpt('vnc_password', - deprecated_name='vnc_password', - deprecated_group='DEFAULT', - help='DEPRECATED. VNC password. The password-based access to ' - 'VNC consoles will be removed in the next release. The ' - 'default value will disable password protection on the ' - 'VNC console.', - secret=True), cfg.BoolOpt('use_linked_clone', default=True, deprecated_name='use_linked_clone', diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py index b5f65991cedc..fa794ef250ae 100644 --- a/nova/virt/vmwareapi/vm_util.py +++ b/nova/virt/vmwareapi/vm_util.py @@ -557,7 +557,7 @@ def get_add_vswitch_port_group_spec(client_factory, vswitch_name, return vswitch_port_group_spec -def get_vnc_config_spec(client_factory, port, password): +def get_vnc_config_spec(client_factory, port): """Builds the vnc config spec.""" virtual_machine_config_spec = client_factory.create( 'ns0:VirtualMachineConfigSpec') @@ -569,15 +569,6 @@ def get_vnc_config_spec(client_factory, port, password): opt_port.key = "RemoteDisplay.vnc.port" opt_port.value = port extras = [opt_enabled, opt_port] - if password: - LOG.deprecated(_("The password-based access to VNC consoles will be " - "removed in the next release. Please, switch to " - "using the default value (this will disable password " - "protection on the VNC console).")) - opt_pass = client_factory.create('ns0:OptionValue') - opt_pass.key = "RemoteDisplay.vnc.password" - opt_pass.value = password - extras.append(opt_pass) virtual_machine_config_spec.extraConfig = extras return virtual_machine_config_spec diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py index cb3b601e2cee..1481009a5d79 100644 --- a/nova/virt/vmwareapi/vmops.py +++ b/nova/virt/vmwareapi/vmops.py @@ -270,8 +270,7 @@ class VMwareVMOps(object): # Set the vnc configuration of the instance, vnc port starts from 5900 if CONF.vnc_enabled: vnc_port = self._get_vnc_port(vm_ref) - vnc_pass = CONF.vmware.vnc_password or '' - self._set_vnc_config(client_factory, instance, vnc_port, vnc_pass) + self._set_vnc_config(client_factory, instance, vnc_port) def _create_virtual_disk(): """Create a virtual disk of the size of flat vmdk file.""" @@ -1389,14 +1388,14 @@ class VMwareVMOps(object): LOG.debug(_("Reconfigured VM instance to set the machine id"), instance=instance) - def _set_vnc_config(self, client_factory, instance, port, password): + def _set_vnc_config(self, client_factory, instance, port): """ Set the vnc configuration of the VM. """ vm_ref = vm_util.get_vm_ref(self._session, instance) vnc_config_spec = vm_util.get_vnc_config_spec( - client_factory, port, password) + client_factory, port) LOG.debug(_("Reconfiguring VM instance to enable vnc on " "port - %(port)s") % {'port': port},