2017-09-16 10:06:08 +00:00
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
|
|
|
|
import mitogen.ssh
|
|
|
|
import mitogen.sudo
|
|
|
|
import mitogen.utils
|
|
|
|
|
|
|
|
@mitogen.utils.run_with_router
|
|
|
|
def main(router):
|
2017-09-21 11:05:35 +00:00
|
|
|
mitogen.utils.log_to_file(io=False)
|
2017-09-16 10:06:08 +00:00
|
|
|
child1 = router.ssh(name='u', hostname='u')
|
|
|
|
child2 = router.sudo(
|
|
|
|
username='sudo_pw_test',
|
|
|
|
password='x',
|
|
|
|
name='sudo_pw_test',
|
|
|
|
via=child1,
|
|
|
|
)
|
|
|
|
child2.call(os.system, 'id')
|