Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
VMware: remove deprecated configuration variable
Removes support for vnc_password configuration variable.

Closes-bug: #1235118

Change-Id: I70fd7d3ee06040d6ce49d93a4becd9cbfdd71f78
  • Loading branch information
gkotton committed Oct 6, 2013
1 parent 0211752 commit 058ea40
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 53 deletions.
6 changes: 0 additions & 6 deletions etc/nova/nova.conf.sample
Expand Up @@ -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=<None>

# Whether to use linked clone (boolean value)
#use_linked_clone=true

Expand Down
4 changes: 0 additions & 4 deletions nova/tests/virt/vmwareapi/test_vmwareapi.py
Expand Up @@ -772,10 +772,6 @@ def _test_get_vnc_console(self):
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")

Expand Down
23 changes: 3 additions & 20 deletions nova/tests/virt/vmwareapi/test_vmwareapi_vm_util.py
Expand Up @@ -298,14 +298,14 @@ def test_get_vmdk_adapter_type(self):
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',
Expand All @@ -318,23 +318,6 @@ def test_get_vnc_config_spec(self):
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),
Expand Down
9 changes: 0 additions & 9 deletions nova/virt/vmwareapi/driver.py
Expand Up @@ -99,15 +99,6 @@
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',
Expand Down
11 changes: 1 addition & 10 deletions nova/virt/vmwareapi/vm_util.py
Expand Up @@ -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')
Expand All @@ -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

Expand Down
7 changes: 3 additions & 4 deletions nova/virt/vmwareapi/vmops.py
Expand Up @@ -270,8 +270,7 @@ def _execute_create_vm():
# 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."""
Expand Down Expand Up @@ -1389,14 +1388,14 @@ def _set_machine_id(self, client_factory, instance, network_info):
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},
Expand Down

0 comments on commit 058ea40

Please sign in to comment.