diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-11-05 12:17:50 +0100 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-11-05 12:17:50 +0100 |
commit | 3c26964c70ef65dca668d62203efbcefee1edb35 (patch) | |
tree | 57ea5b5597f25a246f40ae0f42a3430f45fa03db /bin | |
parent | cc83297724c4496d4daeced8f65113034ef04181 (diff) |
bin:dkms_info: Skip malformed modaliases
Fixes lp:1779080
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dkms_info | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/dkms_info b/bin/dkms_info index ae9a997..9b36a28 100755 --- a/bin/dkms_info +++ b/bin/dkms_info @@ -87,7 +87,12 @@ def get_system_modaliases(): with io.open(os.path.join(root, name), 'rt', encoding='UTF-8') as stream: data = stream.read().strip() - (modalias_type, modalias_string) = data.split(":", 1) + pattern_array = data.split(":", 1) + if len(pattern_array) < 2: + _logger.warning( + "skip pattern {}, not a valid modalias".format(data)) + continue + (modalias_type, modalias_string) = pattern_array if modalias_type not in result: result[modalias_type] = [] |