Skip to content

Commit 47f412b

Browse files
authored
Improve robustness of consutil plugin loading (sonic-net#1353)
The configuration file does not tolerate a new line. Enhance the plugin loading by allowing trailing chars. Signed-off-by: Jing Kan [email protected]
1 parent 64aa1b8 commit 47f412b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consutil/lib.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def init_device_prefix():
270270

271271
if os.path.exists(PLUGIN_PATH):
272272
fp = open(PLUGIN_PATH, 'r')
273-
line = fp.readlines()
274-
SysInfoProvider.DEVICE_PREFIX = "/dev/" + line[0]
273+
lines = fp.readlines()
274+
SysInfoProvider.DEVICE_PREFIX = "/dev/" + lines[0].rstrip()
275275

276276
@staticmethod
277277
def list_console_ttys():

0 commit comments

Comments
 (0)