Whamcloud - gitweb
LU-16267 lnet: fix missing error check in LUTF 51/48951/2
authorCyril Bordage <cbordage@whamcloud.com>
Tue, 25 Oct 2022 16:52:30 +0000 (18:52 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 27 Jan 2023 00:33:50 +0000 (00:33 +0000)
commiteb6518f7fffe7315536a440e582a62f1316e3cd1
tree6603aa4c99745ce716f6154d02fd6579c972d4c7
parente2812e877314bc101efdc5a235c7fae8f7424f96
LU-16267 lnet: fix missing error check in LUTF

In find_replace_file function, the file is opened with default
encoding option. If the file has a different encoding it will fail.
The solution is to use a try/except for UnicodeDecodeError and skip
bad encoded files.

Test-Parameters: @lnet
Signed-off-by: Cyril Bordage <cbordage@whamcloud.com>
Change-Id: I9115d39414d31b628d550e8289b3193d13787288
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48951
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/lutf/python/infra/lutf_file.py