(PDB-1034) fixup missing variant vars, and generalize the local_cmd method

Signed-off-by: Ken Barber <ken@bob.sh>