Fix a few bugs in the run_remote_puppet script

* if then, not if the
* equals on a number gets tested with = not eq
* need to export the function before using it in xargs

Change-Id: I7fc3b6474e9fe3f69e4081e23af3ea4184860cfc
Merge "Fix a few bugs in the run_remote_puppet script"