-
-
Save luto/7592f5f48272714e1208d650fb2df6b1 to your computer and use it in GitHub Desktop.
Mitogen Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mitogen | |
def file_contains(s, path): | |
with open(path, 'rb') as f: | |
return s in f.read() | |
@mitogen.main() | |
def main(router): | |
server = router.ssh(hostname='cygnus.uberspace.de') | |
print(server.call(file_contains, 'luto', '/etc/passwd')) | |
print(server.call(file_contains, 'carlos', '/etc/passwd')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install mitogen | |
$ python mitogen_test.py | |
True | |
False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment