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:
ChangBo Guo(gcb) 2015-07-03 17:51:46 +08:00
parent 36309829f8
commit ae3d970db3
2 changed files with 0 additions and 15 deletions

View File

@ -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,

View File

@ -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()