def begin(arg): print arg with cd('socialscan'): ipaddress,personality=str(arg).split(':') print ipaddress, personality path=str(ipaddress)+'socialscan.config' get('socialscan.config',path) print 'Transferred socialscan.config file from server to localhost for editing' sharing=editor.getInfo(path) shandler=scanname.getName(ipaddress) print sharing print shandler editor.editor(shandler,personality,sharing,path) put(path,'socialscan.config')
def beginclient(): global personality fo=open(inst_dns_file, 'r').readlines() name='New_urltests.txt' for server in fo: print server, personality #fname=open(args_feeder_file,'w') ami=scanname.getName(server, table_names[1]) descript=personality+'_'+ami print descript fname=open('args.txt','w+') fname.write('-u '+name+' -d '+descript) test=fname.read() fname.close() print test subprocess.call(['fab putfeeder:%s,hosts="%s"'%(args_feeder_file,server.strip('\n'))],shell=True) #subprocess.call(['rm args.txt'],shell=True) for server in fo: subprocess.call(['ssh -i ~/.ssh/id_rsa_sscan Administrator@'+server.strip('\n')+' -f "nohup /cygdrive/c/Python27/python.exe socialscan/urlfeeder.py &"'], shell=True) subprocess.call(['ssh -i ~/.ssh/id_rsa_sscan Administrator@'+server.strip('\n')+' -f "exit"'], shell=True) print 'finished starting urlfeeder.py in '+server