cRemote Runner is a module that allows us to copy some files remotely, run or execute on that remote, then copy things back. Internally it uses Paramiko as an SSH interface.
from crrunner import *
eventList = [
ExecuteEvent('ls')
]
'''
We also have:
CopyToRemoteEvent - To copy files to the remote from local
CopyFromRemoteEvent - To copy files from the remote to local
DeleteAllCopiedToRemote - To delete all files (on remote) copied to remote thus far.
'''
runner = cRRunner(remoteIp=<ip>, remoteUsername=<user>, remotePassword=<password>, eventList=eventList)
resultList = runner.run()
print (resultList[0].stdout)
See the docstrings for classes in crrunner.py/event.py
Also see if __name__ == '__main__':
in crrunner.py for a more interesting example.
pip install cRRunner