From c0fd216780cfa9c17da385af63fa743d40434fa0 Mon Sep 17 00:00:00 2001 From: Kashyap Chamarthy Date: Mon, 18 Feb 2019 16:22:45 +0100 Subject: [PATCH] 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 Signed-off-by: Kashyap Chamarthy --- nova/virt/libvirt/driver.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 16be7ade6cb3..a8691c716943 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -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"