Merge "VMware: remove deprecated configuration variable"
This commit is contained in:
@@ -3293,12 +3293,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
|
||||
|
||||
|
@@ -768,10 +768,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.assertEqual(self.conn.get_host_ip_addr(), "test_url")
|
||||
|
||||
|
@@ -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),
|
||||
|
@@ -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',
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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},
|
||||
|
Reference in New Issue
Block a user