HomeClusterLabs Projects

Refactor: cts,python: Clean up uses of the __call__ function.

Description

Refactor: cts,python: Clean up uses of the call function.

  • The blocking and delegate arguments are never passed, so remove them. blocking wasn't even referenced anywhere besides in the parameters.
  • synchronous is a boolean, so treat it like such.
  • Replace silent= with verbose=0/1/2 to help alleviate some of the output changes caused by this patch. Because we were keying on the stdin= parameter to both change the return type and control how much gets printed, there's not really a good way to preserve output with just the silent= parameter - something always gets added or left out regardless.
  • Always return the same type - a tuple of (rc, output). It's up to the callers to handle extracting the data they want from this tuple.
  • If callers don't do anything with one element of the tuple, assign it to _. If callers don't do anything with the return value at all, just don't assign it to anything.
  • Remove unnecessary arguments from calls.
  • Do a better job of handling the possibility that output is empty in various places. There's likely a whole lot more of this to do.
  • Add a comment to the function.

Details

Provenance
clumensAuthored on Mar 16 2023, 11:20 AM
Parents
rP23bc859fb339: Refactor: python: Minor cleanups to remote.py.
Branches
Unknown
Tags
Unknown