From a1eabad2d37bb0d0e9407edf7305e223eba67da2 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 20 Oct 2021 15:58:43 -0700 Subject: [PATCH] add comments --- jc/parsers/uname.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jc/parsers/uname.py b/jc/parsers/uname.py index 02520c8a..3eedd220 100644 --- a/jc/parsers/uname.py +++ b/jc/parsers/uname.py @@ -113,7 +113,11 @@ def parse(data, raw=False, quiet=False): # otherwise use linux parser else: - # fixup for cases where the 'processor' and/or 'hardware_platform' fields are blank + # fixup for cases where 'machine' exists but 'processor' and 'hardware_platform' fields are blank. + # if the fields exist then at least two of the three will be the same. + # if the fields do not exist then none of the fields in those positions will be the same. + # case of only two existing is undefined. Must either be one or all three existing, otherwise + # there will be unexpected results during parsing. fixup = data.split() fixup_set = set([fixup[-2], fixup[-3], fixup[-4]]) if len(fixup_set) > 2: