-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSShconnecting_job.py
43 lines (39 loc) · 979 Bytes
/
SShconnecting_job.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python2
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import socket
import fcntl
import struct
import os
def window():
app = QApplication(sys.argv)
win = QDialog()
b1 = QPushButton(win)
b1.setText("Make Datanode")
b1.move(50,20)
b1.clicked.connect(b1_clicked)
win.setGeometry(100,100,200,100)
win.setWindowTitle("Datanode Terminal")
win.show()
sys.exit(app.exec_())
def b1_clicked():
f = open("datanodes.txt","r")
mip=open("YourIp.txt","r")
mipp=mip.readlines()
myiip=mipp[0]
ip=f.readlines()
k=[]
count=0
for i in ip:
k.append(i)
k[count]=k[count].replace('\n','')
#print k
if(count==0):
os.system("sshpass -p 'ayush' scp -o StrictHostKeyChecking=no autologinjob.py root@"+k[count]+":/root/ ")
os.system("sshpass -p 'ayush' ssh root@"+k[count]+" python autologinjob.py "+k[count])
count=count+1
#os.system("cd /")
#os.system("python autologin.py")
if __name__ == '__main__':
window()