libvirt: Omit needless check on 'CONF.serial_console'

All calls to _create_pty_device() check for
'CONF.serial_console.enabled' themselves; so remove the redundant check
in the function _create_pty_device().

And Georg Hoesch pointed out in a review, this also creates
"functionally symmetric code", as in: the functions
_create_serial_consoles() and _create_pty_device() create the serial
console devices, and the function _create_consoles_qemu_kvm() tells us
what type of console we need.

No tests are added to show nothing functional has changed.

Change-Id: Ic50c6b8c3b1f1b260d2b7caab369e77e4870686f
Suggested-by: Georg Hoesch <georg_hoesch@genua.de>
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
This commit is contained in:
Kashyap Chamarthy 2019-02-18 16:22:45 +01:00
parent fe88d9e2c3
commit c0fd216780

View File

@ -5000,9 +5000,6 @@ class LibvirtDriver(driver.ComputeDriver):
def _create_pty_device(self, guest_cfg, char_dev_cls, target_type=None,
log_path=None):
if CONF.serial_console.enabled:
return
consolepty = char_dev_cls()
consolepty.target_type = target_type
consolepty.type = "pty"