rubick/joker/sandbox/bin/joker.py
Peter Lomakin 601b7170e1 [pep8] Joker pep8 fixes
Import alphabet sort fixes

Add some specifics in .gitignore
2013-10-23 14:26:31 +04:00

25 lines
699 B
Python
Executable File

#!/usr/bin/env python
import json
import paramiko
import sys
nodes = json.loads(sys.stdin.read())['nodes'];
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
while node = pop(nodes):
ssh.connect(node['host']['dst'], port=node['host']['port'],
username=node['user']['name'],
key_filename=node['user']['private_key_path']);
for node in nodes:
ssh.connect(node['host']['dst'], port=node['host']['port'],
username=node['user']['name'],
key_filename=node['user']['private_key_path']);
#stdin, stdout, stderr = ssh.exec_command('arp -ad')
#print stdout.readlines()
ssh.close()