Merge "Register the vnc config options under group 'vnc'"
This commit is contained in:
commit
3b38ae4842
@ -248,7 +248,7 @@ CONF.import_opt('allow_resize_to_same_host', 'nova.compute.api')
|
||||
CONF.import_opt('console_topic', 'nova.console.rpcapi')
|
||||
CONF.import_opt('host', 'nova.netconf')
|
||||
CONF.import_opt('my_ip', 'nova.netconf')
|
||||
CONF.import_opt('vnc_enabled', 'nova.vnc')
|
||||
CONF.import_opt('enabled', 'nova.vnc', group='vnc')
|
||||
CONF.import_opt('enabled', 'nova.spice', group='spice')
|
||||
CONF.import_opt('enable', 'nova.cells.opts', group='cells')
|
||||
CONF.import_opt('image_cache_manager_interval', 'nova.virt.imagecache')
|
||||
@ -4215,15 +4215,15 @@ class ComputeManager(manager.Manager):
|
||||
LOG.debug("Getting vnc console", instance=instance)
|
||||
token = str(uuid.uuid4())
|
||||
|
||||
if not CONF.vnc_enabled:
|
||||
if not CONF.vnc.enabled:
|
||||
raise exception.ConsoleTypeUnavailable(console_type=console_type)
|
||||
|
||||
if console_type == 'novnc':
|
||||
# For essex, novncproxy_base_url must include the full path
|
||||
# including the html file (like http://myhost/vnc_auto.html)
|
||||
access_url = '%s?token=%s' % (CONF.novncproxy_base_url, token)
|
||||
access_url = '%s?token=%s' % (CONF.vnc.novncproxy_base_url, token)
|
||||
elif console_type == 'xvpvnc':
|
||||
access_url = '%s?token=%s' % (CONF.xvpvncproxy_base_url, token)
|
||||
access_url = '%s?token=%s' % (CONF.vnc.xvpvncproxy_base_url, token)
|
||||
else:
|
||||
raise exception.ConsoleTypeInvalid(console_type=console_type)
|
||||
|
||||
@ -5014,7 +5014,7 @@ class ComputeManager(manager.Manager):
|
||||
|
||||
def _consoles_enabled(self):
|
||||
"""Returns whether a console is enable."""
|
||||
return (CONF.vnc_enabled or CONF.spice.enabled or
|
||||
return (CONF.vnc.enabled or CONF.spice.enabled or
|
||||
CONF.rdp.enabled or CONF.serial_console.enabled)
|
||||
|
||||
def _clean_instance_console_tokens(self, ctxt, instance):
|
||||
|
@ -36,7 +36,7 @@ class ConsolesSampleJsonTests(test_servers.ServersSampleBase):
|
||||
|
||||
def setUp(self):
|
||||
super(ConsolesSampleJsonTests, self).setUp()
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
self.flags(enabled=True, group='rdp')
|
||||
self.flags(enabled=True, group='serial_console')
|
||||
|
@ -3201,7 +3201,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_novnc_vnc_console(self):
|
||||
# Make sure we can a vnc console for an instance.
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3216,7 +3216,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
self.compute.terminate_instance(self.context, instance, [], [])
|
||||
|
||||
def test_validate_console_port_vnc(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
instance = self._create_fake_instance_obj()
|
||||
|
||||
@ -3231,7 +3231,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
console_type="novnc"))
|
||||
|
||||
def test_validate_console_port_spice(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
instance = self._create_fake_instance_obj()
|
||||
|
||||
@ -3260,7 +3260,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
console_type="rdp-html5"))
|
||||
|
||||
def test_validate_console_port_wrong_port(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
instance = self._create_fake_instance_obj()
|
||||
|
||||
@ -3276,7 +3276,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_xvpvnc_vnc_console(self):
|
||||
# Make sure we can a vnc console for an instance.
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3290,7 +3290,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_invalid_vnc_console_type(self):
|
||||
# Raise useful error if console type is an unrecognised string.
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3311,7 +3311,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_missing_vnc_console_type(self):
|
||||
# Raise useful error is console type is None.
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3352,7 +3352,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_spicehtml5_spice_console(self):
|
||||
# Make sure we can a spice console for an instance.
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3368,7 +3368,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_invalid_spice_console_type(self):
|
||||
# Raise useful error if console type is an unrecognised string
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3390,7 +3390,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
def test_get_spice_console_not_implemented(self):
|
||||
self.stubs.Set(self.compute.driver, 'get_spice_console',
|
||||
fake_not_implemented)
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3410,7 +3410,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_missing_spice_console_type(self):
|
||||
# Raise useful error is console type is None
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3431,7 +3431,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_rdphtml5_rdp_console(self):
|
||||
# Make sure we can a rdp console for an instance.
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='rdp')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3447,7 +3447,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_invalid_rdp_console_type(self):
|
||||
# Raise useful error if console type is an unrecognised string
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='rdp')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3468,7 +3468,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_missing_rdp_console_type(self):
|
||||
# Raise useful error is console type is None
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='rdp')
|
||||
|
||||
instance = self._create_fake_instance_obj()
|
||||
@ -3488,7 +3488,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
self.compute.terminate_instance(self.context, instance, [], [])
|
||||
|
||||
def test_vnc_console_instance_not_ready(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'vm_state': vm_states.BUILDING})
|
||||
@ -3506,7 +3506,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
instance=instance)
|
||||
|
||||
def test_spice_console_instance_not_ready(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='spice')
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'vm_state': vm_states.BUILDING})
|
||||
@ -3524,7 +3524,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
instance=instance)
|
||||
|
||||
def test_rdp_console_instance_not_ready(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=True, group='rdp')
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'vm_state': vm_states.BUILDING})
|
||||
@ -3542,7 +3542,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
instance=instance)
|
||||
|
||||
def test_vnc_console_disabled(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
instance = self._create_fake_instance_obj(
|
||||
params={'vm_state': vm_states.BUILDING})
|
||||
|
||||
@ -3963,7 +3963,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_delete_instance_deletes_console_auth_tokens(self):
|
||||
instance = self._create_fake_instance_obj()
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
|
||||
self.tokens_deleted = False
|
||||
|
||||
@ -3981,7 +3981,7 @@ class ComputeTestCase(BaseTestCase):
|
||||
|
||||
def test_delete_instance_deletes_console_auth_tokens_cells(self):
|
||||
instance = self._create_fake_instance_obj()
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(enable=True, group='cells')
|
||||
|
||||
self.tokens_deleted = False
|
||||
|
@ -3662,15 +3662,15 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase):
|
||||
self._test_revert_resize_instance_destroy_disks(is_shared=False)
|
||||
|
||||
def test_consoles_enabled(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(enabled=False, group='spice')
|
||||
self.flags(enabled=False, group='rdp')
|
||||
self.flags(enabled=False, group='serial_console')
|
||||
self.assertFalse(self.compute._consoles_enabled())
|
||||
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.assertTrue(self.compute._consoles_enabled())
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
|
||||
for console in ['spice', 'rdp', 'serial_console']:
|
||||
self.flags(enabled=True, group=console)
|
||||
|
@ -2239,7 +2239,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
mock_save.assert_called_with()
|
||||
|
||||
def test_get_guest_config_with_vnc(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=False,
|
||||
group='libvirt')
|
||||
@ -2272,7 +2272,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(cfg.devices[4].type, "vnc")
|
||||
|
||||
def test_get_guest_config_with_vnc_and_tablet(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=True,
|
||||
group='libvirt')
|
||||
@ -2308,7 +2308,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(cfg.devices[5].type, "vnc")
|
||||
|
||||
def test_get_guest_config_with_spice_and_tablet(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=True,
|
||||
group='libvirt')
|
||||
@ -2346,7 +2346,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(cfg.devices[5].type, "spice")
|
||||
|
||||
def test_get_guest_config_with_spice_and_agent(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=True,
|
||||
group='libvirt')
|
||||
@ -2644,7 +2644,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
instance, mode=mode)
|
||||
|
||||
def test_get_guest_config_with_type_xen(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='xen',
|
||||
use_usb_tablet=False,
|
||||
group='libvirt')
|
||||
@ -2679,7 +2679,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
@mock.patch.object(libvirt_driver.libvirt_utils, 'get_arch',
|
||||
return_value=arch.S390X)
|
||||
def test_get_guest_config_with_type_kvm_on_s390(self, mock_get_arch):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=False,
|
||||
group='libvirt')
|
||||
@ -2728,7 +2728,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
return drvr._get_guest_config(instance, [], {}, disk_info)
|
||||
|
||||
def test_get_guest_config_with_type_xen_pae_hvm(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='xen',
|
||||
use_usb_tablet=False,
|
||||
group='libvirt')
|
||||
@ -2757,7 +2757,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
vconfig.LibvirtConfigGuestFeatureAPIC)
|
||||
|
||||
def test_get_guest_config_with_type_xen_pae_pvm(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='xen',
|
||||
use_usb_tablet=False,
|
||||
group='libvirt')
|
||||
@ -2780,7 +2780,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
vconfig.LibvirtConfigGuestFeaturePAE)
|
||||
|
||||
def test_get_guest_config_with_vnc_and_spice(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(virt_type='kvm',
|
||||
use_usb_tablet=True,
|
||||
group='libvirt')
|
||||
@ -2877,7 +2877,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
|
||||
def _test_get_guest_usb_tablet(self, vnc_enabled, spice_enabled, os_type,
|
||||
agent_enabled=False):
|
||||
self.flags(vnc_enabled=vnc_enabled)
|
||||
self.flags(enabled=vnc_enabled, group='vnc')
|
||||
self.flags(enabled=spice_enabled,
|
||||
agent_enabled=agent_enabled, group='spice')
|
||||
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
|
||||
@ -3082,7 +3082,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(cfg.devices[7].target_name, "org.qemu.guest_agent.0")
|
||||
|
||||
def test_get_guest_config_with_video_driver_vram(self):
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(virt_type='kvm', group='libvirt')
|
||||
self.flags(enabled=True,
|
||||
agent_enabled=True,
|
||||
@ -3928,7 +3928,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(cfg.devices[device_index].type, 'vga')
|
||||
|
||||
def test_get_guest_config_ppc64_through_image_meta_vnc_enabled(self):
|
||||
self.flags(vnc_enabled=True)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self._test_get_guest_config_ppc64(6)
|
||||
|
||||
def test_get_guest_config_ppc64_through_image_meta_spice_enabled(self):
|
||||
@ -5980,7 +5980,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
||||
@mock.patch.object(fakelibvirt, 'VIR_DOMAIN_XML_MIGRATABLE', None,
|
||||
create=True)
|
||||
def test_live_migration_fails_without_migratable_flag_or_0_addr(self):
|
||||
self.flags(vnc_enabled=True, vncserver_listen='1.2.3.4')
|
||||
self.flags(enabled=True, vncserver_listen='1.2.3.4', group='vnc')
|
||||
self.compute = importutils.import_object(CONF.compute_manager)
|
||||
instance_dict = dict(self.test_instance)
|
||||
instance_dict.update({'host': 'fake',
|
||||
|
@ -48,7 +48,7 @@ class ConfigDriveTestCase(test.NoDBTestCase):
|
||||
host_username='test_username',
|
||||
host_password='test_pass',
|
||||
use_linked_clone=False, group='vmware')
|
||||
self.flags(vnc_enabled=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
vmwareapi_fake.reset()
|
||||
stubs.set_stubs(self.stubs)
|
||||
nova.tests.unit.image.fake.stub_out_image_service(self.stubs)
|
||||
|
@ -178,8 +178,8 @@ class VMwareAPIVMTestCase(test.NoDBTestCase):
|
||||
host_password='test_pass',
|
||||
api_retry_count=1,
|
||||
use_linked_clone=False, group='vmware')
|
||||
self.flags(vnc_enabled=False,
|
||||
image_cache_subdirectory_name='vmware_base',
|
||||
self.flags(enabled=False, group='vnc')
|
||||
self.flags(image_cache_subdirectory_name='vmware_base',
|
||||
my_ip='')
|
||||
self.user_id = 'fake'
|
||||
self.project_id = 'fake'
|
||||
|
@ -56,10 +56,10 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
|
||||
super(VMwareVMOpsTestCase, self).setUp()
|
||||
vmwareapi_fake.reset()
|
||||
stubs.set_stubs(self.stubs)
|
||||
self.flags(enabled=True, group='vnc')
|
||||
self.flags(image_cache_subdirectory_name='vmware_base',
|
||||
my_ip='',
|
||||
flat_injected=True,
|
||||
vnc_enabled=True)
|
||||
flat_injected=True)
|
||||
self._context = context.RequestContext('fake_user', 'fake_project')
|
||||
self._session = driver.VMwareAPISession()
|
||||
|
||||
@ -861,7 +861,8 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
|
||||
self.assertNotIn('scrubme', args[0])
|
||||
|
||||
mock_debug.side_effect = fake_debug
|
||||
self.flags(flat_injected=False, vnc_enabled=False)
|
||||
self.flags(flat_injected=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
|
||||
# Call spawn(). We don't care what it does as long as it generates
|
||||
# the log message, which we check below.
|
||||
@ -929,7 +930,8 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
|
||||
'disk_bus': constants.DEFAULT_ADAPTER_TYPE,
|
||||
'mount_device': '/dev/sdc'}]
|
||||
bdi = {'block_device_mapping': bdm, 'root_device_name': '/dev/sda'}
|
||||
self.flags(flat_injected=False, vnc_enabled=False)
|
||||
self.flags(flat_injected=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
|
||||
image_size = (self._instance.root_gb) * units.Gi / 2
|
||||
image_info = images.VMwareImage(
|
||||
@ -987,7 +989,8 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
|
||||
'connection_info': connection_info3,
|
||||
'disk_bus': constants.ADAPTER_TYPE_LSILOGICSAS}]
|
||||
bdi = {'block_device_mapping': bdm}
|
||||
self.flags(flat_injected=False, vnc_enabled=False)
|
||||
self.flags(flat_injected=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
|
||||
image_info = mock.sentinel.image_info
|
||||
vi = get_vm_config_info.return_value
|
||||
@ -1034,7 +1037,8 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
|
||||
'connection_info': connection_info,
|
||||
'disk_bus': 'invalid_adapter_type'}]
|
||||
bdi = {'block_device_mapping': bdm}
|
||||
self.flags(flat_injected=False, vnc_enabled=False)
|
||||
self.flags(flat_injected=False)
|
||||
self.flags(enabled=False, group='vnc')
|
||||
|
||||
image_info = mock.sentinel.image_info
|
||||
vi = get_vm_config_info.return_value
|
||||
|
@ -239,7 +239,7 @@ CONF.import_opt('cipher', 'nova.compute.api',
|
||||
CONF.import_opt('key_size', 'nova.compute.api',
|
||||
group='ephemeral_storage_encryption')
|
||||
CONF.import_opt('live_migration_retry_count', 'nova.compute.manager')
|
||||
CONF.import_opt('vncserver_proxyclient_address', 'nova.vnc')
|
||||
CONF.import_opt('vncserver_proxyclient_address', 'nova.vnc', group='vnc')
|
||||
CONF.import_opt('server_proxyclient_address', 'nova.spice', group='spice')
|
||||
CONF.import_opt('vcpu_pin_set', 'nova.virt.hardware')
|
||||
CONF.import_opt('vif_plugging_is_fatal', 'nova.virt.driver')
|
||||
@ -2558,7 +2558,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
raise exception.ConsoleTypeUnavailable(console_type='vnc')
|
||||
|
||||
port = get_vnc_port_for_instance(instance.name)
|
||||
host = CONF.vncserver_proxyclient_address
|
||||
host = CONF.vnc.vncserver_proxyclient_address
|
||||
|
||||
return ctype.ConsoleVNC(host=host, port=port)
|
||||
|
||||
@ -4131,12 +4131,12 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
# those versions are. We'll just let libvirt report the
|
||||
# errors appropriately if the user enables both.
|
||||
add_video_driver = False
|
||||
if ((CONF.vnc_enabled and
|
||||
if ((CONF.vnc.enabled and
|
||||
virt_type not in ('lxc', 'uml'))):
|
||||
graphics = vconfig.LibvirtConfigGuestGraphics()
|
||||
graphics.type = "vnc"
|
||||
graphics.keymap = CONF.vnc_keymap
|
||||
graphics.listen = CONF.vncserver_listen
|
||||
graphics.keymap = CONF.vnc.keymap
|
||||
graphics.listen = CONF.vnc.vncserver_listen
|
||||
guest.add_device(graphics)
|
||||
add_video_driver = True
|
||||
|
||||
@ -4210,7 +4210,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
# at the same time, we'll get the tablet whether the
|
||||
# SPICE agent is used or not.
|
||||
need_usb_tablet = False
|
||||
if CONF.vnc_enabled:
|
||||
if CONF.vnc.enabled:
|
||||
need_usb_tablet = CONF.libvirt.use_usb_tablet
|
||||
elif CONF.spice.enabled and not CONF.spice.agent_enabled:
|
||||
need_usb_tablet = CONF.libvirt.use_usb_tablet
|
||||
@ -5407,10 +5407,10 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
def _check_graphics_addresses_can_live_migrate(self, listen_addrs):
|
||||
LOCAL_ADDRS = ('0.0.0.0', '127.0.0.1', '::', '::1')
|
||||
|
||||
local_vnc = CONF.vncserver_listen in LOCAL_ADDRS
|
||||
local_vnc = CONF.vnc.vncserver_listen in LOCAL_ADDRS
|
||||
local_spice = CONF.spice.server_listen in LOCAL_ADDRS
|
||||
|
||||
if ((CONF.vnc_enabled and not local_vnc) or
|
||||
if ((CONF.vnc.enabled and not local_vnc) or
|
||||
(CONF.spice.enabled and not local_spice)):
|
||||
|
||||
msg = _('Your libvirt version does not support the'
|
||||
@ -5428,7 +5428,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
dest_local_vnc = listen_addrs['vnc'] in LOCAL_ADDRS
|
||||
dest_local_spice = listen_addrs['spice'] in LOCAL_ADDRS
|
||||
|
||||
if ((CONF.vnc_enabled and not dest_local_vnc) or
|
||||
if ((CONF.vnc.enabled and not dest_local_vnc) or
|
||||
(CONF.spice.enabled and not dest_local_spice)):
|
||||
|
||||
LOG.warn(_LW('Your libvirt version does not support the'
|
||||
@ -5939,7 +5939,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
|
||||
# Store vncserver_listen and latest disk device info
|
||||
res_data = {'graphics_listen_addrs': {}, 'volume': {}}
|
||||
res_data['graphics_listen_addrs']['vnc'] = CONF.vncserver_listen
|
||||
res_data['graphics_listen_addrs']['vnc'] = CONF.vnc.vncserver_listen
|
||||
res_data['graphics_listen_addrs']['spice'] = CONF.spice.server_listen
|
||||
for vol in block_device_mapping:
|
||||
connection_info = vol['connection_info']
|
||||
|
@ -889,7 +889,7 @@ def get_vnc_config_spec(client_factory, port):
|
||||
opt_port.value = port
|
||||
opt_keymap = client_factory.create('ns0:OptionValue')
|
||||
opt_keymap.key = "RemoteDisplay.vnc.keyMap"
|
||||
opt_keymap.value = CONF.vnc_keymap
|
||||
opt_keymap.value = CONF.vnc.keymap
|
||||
|
||||
extras = [opt_enabled, opt_port, opt_keymap]
|
||||
|
||||
|
@ -73,7 +73,7 @@ CONF.register_opts(vmops_opts, 'vmware')
|
||||
|
||||
CONF.import_opt('image_cache_subdirectory_name', 'nova.virt.imagecache')
|
||||
CONF.import_opt('remove_unused_base_images', 'nova.virt.imagecache')
|
||||
CONF.import_opt('vnc_enabled', 'nova.vnc')
|
||||
CONF.import_opt('enabled', 'nova.vnc', group='vnc')
|
||||
CONF.import_opt('my_ip', 'nova.netconf')
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -617,7 +617,7 @@ class VMwareVMOps(object):
|
||||
vm_ref=vm_ref)
|
||||
|
||||
# Set the vnc configuration of the instance, vnc port starts from 5900
|
||||
if CONF.vnc_enabled:
|
||||
if CONF.vnc.enabled:
|
||||
self._get_and_set_vnc_config(client_factory, instance, vm_ref)
|
||||
|
||||
block_device_mapping = []
|
||||
|
@ -76,7 +76,7 @@ xenapi_vmops_opts = [
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(xenapi_vmops_opts, 'xenserver')
|
||||
CONF.import_opt('host', 'nova.netconf')
|
||||
CONF.import_opt('vncserver_proxyclient_address', 'nova.vnc')
|
||||
CONF.import_opt('vncserver_proxyclient_address', 'nova.vnc', group='vnc')
|
||||
|
||||
DEFAULT_FIREWALL_DRIVER = "%s.%s" % (
|
||||
firewall.__name__,
|
||||
@ -1784,7 +1784,7 @@ class VMOps(object):
|
||||
|
||||
# NOTE: XS5.6sp2+ use http over port 80 for xenapi com
|
||||
return ctype.ConsoleVNC(
|
||||
host=CONF.vncserver_proxyclient_address,
|
||||
host=CONF.vnc.vncserver_proxyclient_address,
|
||||
port=80,
|
||||
internal_access_path=path)
|
||||
|
||||
|
@ -23,25 +23,37 @@ vnc_opts = [
|
||||
cfg.StrOpt('novncproxy_base_url',
|
||||
default='http://127.0.0.1:6080/vnc_auto.html',
|
||||
help='Location of VNC console proxy, in the form '
|
||||
'"http://127.0.0.1:6080/vnc_auto.html"'),
|
||||
'"http://127.0.0.1:6080/vnc_auto.html"',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='novncproxy_base_url'),
|
||||
cfg.StrOpt('xvpvncproxy_base_url',
|
||||
default='http://127.0.0.1:6081/console',
|
||||
help='Location of nova xvp VNC console proxy, in the form '
|
||||
'"http://127.0.0.1:6081/console"'),
|
||||
'"http://127.0.0.1:6081/console"',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='xvpvncproxy_base_url'),
|
||||
cfg.StrOpt('vncserver_listen',
|
||||
default='127.0.0.1',
|
||||
help='IP address on which instance vncservers should listen'),
|
||||
help='IP address on which instance vncservers should listen',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='vncserver_listen'),
|
||||
cfg.StrOpt('vncserver_proxyclient_address',
|
||||
default='127.0.0.1',
|
||||
help='The address to which proxy clients '
|
||||
'(like nova-xvpvncproxy) should connect'),
|
||||
cfg.BoolOpt('vnc_enabled',
|
||||
'(like nova-xvpvncproxy) should connect',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='vncserver_proxyclient_address'),
|
||||
cfg.BoolOpt('enabled',
|
||||
default=True,
|
||||
help='Enable VNC related features'),
|
||||
cfg.StrOpt('vnc_keymap',
|
||||
help='Enable VNC related features',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='vnc_enabled'),
|
||||
cfg.StrOpt('keymap',
|
||||
default='en-us',
|
||||
help='Keymap for VNC'),
|
||||
help='Keymap for VNC',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='vnc_keymap'),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.register_opts(vnc_opts)
|
||||
CONF.register_opts(vnc_opts, group='vnc')
|
||||
|
Loading…
Reference in New Issue
Block a user