libvirt:Remove duplicated check code for config option sysinfo_serial
In oslo.config StrOpt provide parameter choices, that means the option's value must be in the choices, otherewise an exception will be raised. The current exception is NoSuchOptError. sysinfo_serial_funcs.get(CONF.libvirt.sysinfo_serial) always return non-None value, so remove duplicatd check code. Change-Id: If9ff88a69a70b86dd72916f5926c3e47516b5e3b Partial-Bug: #1471168
This commit is contained in:
parent
36309829f8
commit
ae3d970db3
|
@ -3850,14 +3850,6 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
|||
|
||||
self._test_get_guest_config_sysinfo_serial(theuuid)
|
||||
|
||||
def test_get_guest_config_sysinfo_serial_invalid(self):
|
||||
self.flags(sysinfo_serial="invalid", group="libvirt")
|
||||
|
||||
self.assertRaises(exception.NovaException,
|
||||
libvirt_driver.LibvirtDriver,
|
||||
fake.FakeVirtAPI(),
|
||||
True)
|
||||
|
||||
def _create_fake_service_compute(self):
|
||||
service_info = {
|
||||
'id': 1729,
|
||||
|
|
|
@ -519,13 +519,6 @@ class LibvirtDriver(driver.ComputeDriver):
|
|||
|
||||
self._sysinfo_serial_func = sysinfo_serial_funcs.get(
|
||||
CONF.libvirt.sysinfo_serial)
|
||||
if not self._sysinfo_serial_func:
|
||||
raise exception.NovaException(
|
||||
_("Unexpected sysinfo_serial setting '%(actual)s'. "
|
||||
"Permitted values are %(expect)s'") %
|
||||
{'actual': CONF.libvirt.sysinfo_serial,
|
||||
'expect': ', '.join("'%s'" % k for k in
|
||||
sysinfo_serial_funcs.keys())})
|
||||
|
||||
self.job_tracker = instancejobtracker.InstanceJobTracker()
|
||||
self._remotefs = remotefs.RemoteFilesystem()
|
||||
|
|
Loading…
Reference in New Issue