From 47f412bf150f445c64e917d9d8ce259043013fa1 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 25 Jan 2021 22:09:32 -0800 Subject: [PATCH] Improve robustness of consutil plugin loading (#1353) The configuration file does not tolerate a new line. Enhance the plugin loading by allowing trailing chars. Signed-off-by: Jing Kan jika@microsoft.com --- consutil/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consutil/lib.py b/consutil/lib.py index 0172ac5644c5..d1aee008dfd3 100644 --- a/consutil/lib.py +++ b/consutil/lib.py @@ -270,8 +270,8 @@ def init_device_prefix(): if os.path.exists(PLUGIN_PATH): fp = open(PLUGIN_PATH, 'r') - line = fp.readlines() - SysInfoProvider.DEVICE_PREFIX = "/dev/" + line[0] + lines = fp.readlines() + SysInfoProvider.DEVICE_PREFIX = "/dev/" + lines[0].rstrip() @staticmethod def list_console_ttys():