It is useful to have both a return code and output of the command.
Add a new wrapper rc_cmd that returns both:
>>> rc_cmd('uname')
(0, 'Linux')
>>>
>>> rc_cmd('sudo ip --json --brief link show dev noname')
(1, 'Device "noname" does not exist.')
>>>