Open pmoravec opened 4 years ago
Reviewing a code, I think that
https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1656-L1657
is redundant, due to
https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1577
assuming pred can be None. And indeed, https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1570-L1573 calls self._add_cmd_output without pred set, and it works well. But looking down to https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L768 , I start to feel None will be returned after the two lines removal, hence all cmds with no predicate would fail..?
pred
None
self._add_cmd_output
(but still in that case, I would feel the setting dummy predicate on L1656-L1657 as redundant - test None predicate should pass, not fail, no?)
@pmoravec is this issue still relevant?
Reviewing a code, I think that
https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1656-L1657
is redundant, due to
https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1577
assuming
pred
can beNone
. And indeed, https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L1570-L1573 callsself._add_cmd_output
withoutpred
set, and it works well. But looking down to https://github.com/sosreport/sos/blob/master/sos/report/plugins/__init__.py#L768 , I start to feelNone
will be returned after the two lines removal, hence all cmds with no predicate would fail..?(but still in that case, I would feel the setting dummy predicate on L1656-L1657 as redundant - test None predicate should pass, not fail, no?)