sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
514 stars 540 forks source link

Redundant setting predicate in add_cmd_output ? #2204

Open pmoravec opened 4 years ago

pmoravec commented 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..?

(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?)

jcastill commented 2 days ago

@pmoravec is this issue still relevant?