How to use readlines method in refurb

Best Python code snippet using refurb_python

diffuser.py

Source:diffuser.py Github

copy

Full Screen

...183 "sudo mkdir /mnt/export;"184 "mount /dev/sdc /mnt/export/;"185 "chmod o+wx /etc/exports;"186 "'")187 print stdout.readlines()188 print stderr.readlines()189 liste_der_maschinen = ""190 191 for i in range(ANZ):192 if i != 0:193 liste_der_maschinen = liste_der_maschinen + reservation.instances[i].public_dns_name+"(rw,sync,no_root_squash,no_subtree_check) "194 195 stdin, stdout, stderr = client.exec_command("sudo echo '/mnt/export "+liste_der_maschinen+"' >> /etc/exports")196 print stdout.readlines()197 print stderr.readlines()198 stdin, stdout, stderr = client.exec_command(199 "sudo /bin/sh -c '"200 "chmod o-wx /etc/exports;"201 "exportfs -a;"202 "'")203 print stdout.readlines()204 print stderr.readlines()205 chan.close()206 client.close()207 208 except Exception, e:209 print '*** Caught exception: %s: %s' % (e.__class__, e)210 traceback.print_exc()211 try:212 client.close()213 except:214 pass215 sys.exit(1)216 217 218 # Deploy the client(s)219 for i in range(ANZ):220 if i != 0:221 try:222 client = paramiko.SSHClient()223 client.load_system_host_keys()224 client.set_missing_host_key_policy(paramiko.WarningPolicy)225 # auto-accept unknown keys226 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())227 print 'Connecting...'228 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)229 chan = client.invoke_shell()230 print repr(client.get_transport())231 print 'The system creates the NFS clients.'232 print233 stdin, stdout, stderr = client.exec_command(234 "sudo /bin/sh -c '"235 "hostname;"236 "apt-get update;"237 "apt-get -y install nfs-common;"238 "mkdir /mnt/export;"239 "chmod o+wx /etc/fstab;"240 "echo "+reservation.instances[0].public_dns_name+":/mnt/export /mnt/export nfs auto,rw,bg 0 0 >> /etc/fstab;"241 "chmod o-wx /etc/fstab;"242 "mount /mnt/export/;"243 "'")244 print stdout.readlines()245 print stderr.readlines()246 chan.close()247 client.close()248 249 except Exception, e:250 print '*** Caught exception: %s: %s' % (e.__class__, e)251 traceback.print_exc()252 try:253 client.close()254 except:255 pass256 sys.exit(1)257 258elif filesystem == 2:259 # Here comes GlusterFS with redundancy260 261 # Get the first two instances. They will be the server262 zone = reservation.instances[0].placement263 instance_id1 = reservation.instances[0].id264 instance_id2 = reservation.instances[1].id265 print 266 267 try:268 # try to create the EBS volume269 neues_volume1 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)270 except EC2ResponseError:271 # An error occured272 print "While the system tried to create the EBS volume, an error occured." 273 else:274 print "The EBS volume "+neues_volume1.id+" was created successfully." 275 276 # Give the system some time to create the volume277 time.sleep(5)278 print279 280 try:281 # try to attach EBS volumne with the fist instance282 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume1.id, instance_id1, device)283 except EC2ResponseError:284 # An error occured285 print "While the system tried to attach the EBS volume with the instance "+str(instance_id1)+", an error occured." 286 else:287 print "Volume "+neues_volume1.id+" was attached with the instance "+str(instance_id1)+" successfully." 288 289 print290 291 try:292 # try to create the EBS volume293 neues_volume2 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)294 except EC2ResponseError:295 # An error occured296 print "While the system tried to create the EBS volume, an error occured." 297 else:298 print "The EBS volume "+neues_volume2.id+" was created successfully." 299 300 # Give the system some time to create the volume301 time.sleep(5)302 print303 304 try:305 # try to attach EBS volumne with the fist instance306 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume2.id, instance_id2, device)307 except EC2ResponseError:308 # An error occured309 print "While the system tried to attach the EBS volume with the instance "+str(instance_id2)+", an error occured." 310 else:311 print "Volume "+neues_volume2.id+" was attached with the instance "+str(instance_id2)+" successfully." 312 313 # Give the system some time to start the instances314 time.sleep(10)315 316 317 318 # Configuration of server319 for i in range(ANZ_Server):320 if i != ANZ_Server:321 try:322 # Upload of file glusterfs-3.0.5.tar.gz to the server 323 hostname = reservation.instances[i].public_dns_name324 325 transport = paramiko.Transport((hostname, port))326 transport.connect(username = username, pkey = key)327 328 sftp = paramiko.SFTPClient.from_transport(transport)329 330 remotepath = '/tmp/glusterfs-3.0.5.tar.gz'331 localpath = 'glusterfs-3.0.5.tar.gz'332 sftp.put(localpath, remotepath)333 334 sftp.close()335 transport.close()336 337 client = paramiko.SSHClient()338 client.load_system_host_keys()339 client.set_missing_host_key_policy(paramiko.WarningPolicy)340 # auto-accept unknown keys341 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())342 print 'Connecting...'343 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)344 chan = client.invoke_shell()345 print repr(client.get_transport())346 print 'The system creates the GlusterFS server.'347 print348 stdin, stdout, stderr = client.exec_command("sudo hostname")349 print stdout.readlines()350 print stderr.readlines()351 stdin, stdout, stderr = client.exec_command("sudo apt-get update")352 print stdout.readlines()353 print stderr.readlines()354 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install flex bison")355 print stdout.readlines()356 print stderr.readlines()357# stdin, stdout, stderr = client.exec_command("sudo wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.5.tar.gz -P /tmp/")358# print stdout.readlines()359# print stderr.readlines()360 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /tmp/glusterfs-3.0.5.tar.gz -C /tmp/")361 print stdout.readlines()362 print stderr.readlines()363 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; ./configure --prefix='")364 print stdout.readlines()365 print stderr.readlines()366 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make'")367 print stdout.readlines()368 print stderr.readlines()369 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make install'")370 print stdout.readlines()371 print stderr.readlines()372 stdin, stdout, stderr = client.exec_command("sudo ldconfig")373 print stdout.readlines()374 print stderr.readlines()375 stdin, stdout, stderr = client.exec_command("sudo glusterfs --version")376 print stdout.readlines()377 print stderr.readlines()378 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'sudo echo y | mkfs.ext3 /dev/sdc'")379 print stdout.readlines()380 print stderr.readlines()381 stdin, stdout, stderr = client.exec_command("sudo chmod o+wx /etc/fstab")382 print stdout.readlines()383 print stderr.readlines()384 stdin, stdout, stderr = client.exec_command("sudo echo '/dev/sdc /gluster ext3 noatime 0 0' >> /etc/fstab")385 print stdout.readlines()386 print stderr.readlines()387 stdin, stdout, stderr = client.exec_command("sudo chmod o-wx /etc/fstab")388 print stdout.readlines()389 print stderr.readlines()390 stdin, stdout, stderr = client.exec_command("sudo mkdir /gluster")391 print stdout.readlines()392 print stderr.readlines()393 stdin, stdout, stderr = client.exec_command("sudo mount /gluster")394 print stdout.readlines()395 print stderr.readlines()396 stdin, stdout, stderr = client.exec_command("sudo mkdir /gluster/export")397 print stdout.readlines()398 print stderr.readlines()399 400 liste_der_maschinen = ""401 402 for i in range(ANZ_Server):403 if i != ANZ_Server:404 liste_der_maschinen = liste_der_maschinen + reservation.instances[i].public_dns_name+":/gluster/export "405 406 stdin, stdout, stderr = client.exec_command("sudo glusterfs-volgen --name repstore1 --raid 1 "+liste_der_maschinen)407 print stdout.readlines()408 print stderr.readlines()409 410 vol_datename = reservation.instances[i].public_dns_name+"-repstore1-export.vol"411 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp "+vol_datename+" /etc/glusterfs/glusterfsd.vol'")412 print stdout.readlines()413 print stderr.readlines()414 415 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp repstore1-tcp.vol /etc/glusterfs/glusterfs.vol'")416 print stdout.readlines()417 print stderr.readlines()418 stdin, stdout, stderr = client.exec_command("sudo glusterfsd -f /etc/glusterfs/glusterfsd.vol")419 print stdout.readlines()420 print stderr.readlines()421 stdin, stdout, stderr = client.exec_command("sudo ps -aux | grep gluster")422 print stdout.readlines()423 print stderr.readlines()424 chan.close()425 client.close()426 427 except Exception, e:428 print '*** Caught exception: %s: %s' % (e.__class__, e)429 traceback.print_exc()430 try:431 client.close()432 except:433 pass434 sys.exit(1)435 436 437 # Datei repstore1-tcp.vol vom 1.Server holen438 try:439 hostname = reservation.instances[0].public_dns_name440 transport = paramiko.Transport((hostname, port))441 transport.connect(username = username, pkey = key)442 443 sftp = paramiko.SFTPClient.from_transport(transport)444 445 filepath = '/home/ubuntu/repstore1-tcp.vol'446 localpath = 'repstore1-tcp.vol'447 sftp.get(filepath, localpath)448 449 sftp.close()450 transport.close()451 452 except Exception, e:453 print '*** Caught exception: %s: %s' % (e.__class__, e)454 traceback.print_exc()455 try:456 client.close()457 except:458 pass459 sys.exit(1)460 461 462 # Deploy the client(s)463 for i in range(ANZ):464 if i == (ANZ-1):465 try:466 # Upload of file glusterfs-3.0.5.tar.gz to the client 467 hostname = reservation.instances[i].public_dns_name468 469 transport = paramiko.Transport((hostname, port))470 transport.connect(username = username, pkey = key)471 472 sftp = paramiko.SFTPClient.from_transport(transport)473 474 remotepath = '/tmp/glusterfs-3.0.5.tar.gz'475 localpath = 'glusterfs-3.0.5.tar.gz'476 sftp.put(localpath, remotepath)477 478 sftp.close()479 transport.close()480 481 client = paramiko.SSHClient()482 client.load_system_host_keys()483 client.set_missing_host_key_policy(paramiko.WarningPolicy)484 # auto-accept unknown keys485 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())486 print 'Connecting...'487 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)488 chan = client.invoke_shell()489 print repr(client.get_transport())490 print 'The system creates the GlusterFS clients.'491 print492 stdin, stdout, stderr = client.exec_command("sudo hostname")493 print stdout.readlines()494 print stderr.readlines()495 stdin, stdout, stderr = client.exec_command("sudo apt-get update")496 print stdout.readlines()497 print stderr.readlines()498 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install flex bison")499 print stdout.readlines()500 print stderr.readlines()501# stdin, stdout, stderr = client.exec_command("sudo wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.5.tar.gz -P /tmp/")502# print stdout.readlines()503# print stderr.readlines()504 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /tmp/glusterfs-3.0.5.tar.gz -C /tmp/")505 print stdout.readlines()506 print stderr.readlines()507 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; ./configure --prefix='")508 print stdout.readlines()509 print stderr.readlines()510 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make'")511 print stdout.readlines()512 print stderr.readlines()513 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make install'")514 print stdout.readlines()515 print stderr.readlines()516 stdin, stdout, stderr = client.exec_command("sudo ldconfig")517 print stdout.readlines()518 print stderr.readlines()519 stdin, stdout, stderr = client.exec_command("sudo glusterfs --version")520 print stdout.readlines()521 print stderr.readlines()522 stdin, stdout, stderr = client.exec_command("sudo modprobe fuse")523 print stdout.readlines()524 print stderr.readlines()525 stdin, stdout, stderr = client.exec_command("sudo mkdir /glusterfs")526 print stdout.readlines()527 print stderr.readlines()528 529 chan.close()530 client.close()531 532 # Datei repstore1-tcp.vol auf den Client hochladen 533 hostname = reservation.instances[i].public_dns_name534 535 transport = paramiko.Transport((hostname, port))536 transport.connect(username = username, pkey = key)537 538 sftp = paramiko.SFTPClient.from_transport(transport)539 540 remotepath = '/home/ubuntu/repstore1-tcp.vol'541 localpath = 'repstore1-tcp.vol'542 sftp.put(localpath, remotepath)543 544 sftp.close()545 transport.close()546 547 548 except Exception, e:549 print '*** Caught exception: %s: %s' % (e.__class__, e)550 traceback.print_exc()551 try:552 client.close()553 except:554 pass555 sys.exit(1)556 557 558 559 # Deploy the client(s)560 for i in range(ANZ):561 if i == (ANZ-1):562 try:563 client = paramiko.SSHClient()564 client.load_system_host_keys()565 client.set_missing_host_key_policy(paramiko.WarningPolicy)566 # auto-accept unknown keys567 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())568 print 'Connecting...'569 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)570 chan = client.invoke_shell()571 print repr(client.get_transport())572 print 'The system creates the GlusterFS clients.'573 print574 stdin, stdout, stderr = client.exec_command("sudo hostname")575 print stdout.readlines()576 print stderr.readlines()577 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp repstore1-tcp.vol /etc/glusterfs/'")578 print stdout.readlines()579 print stderr.readlines()580 stdin, stdout, stderr = client.exec_command("sudo mount -t glusterfs /etc/glusterfs/repstore1-tcp.vol /glusterfs")581 print stdout.readlines()582 print stderr.readlines()583 stdin, stdout, stderr = client.exec_command("sudo df")584 print stdout.readlines()585 print stderr.readlines()586 stdin, stdout, stderr = client.exec_command("sudo tail /var/log/glusterfs/glusterfs.log")587 print stdout.readlines()588 print stderr.readlines()589 chan.close()590 client.close()591 592 except Exception, e:593 print '*** Caught exception: %s: %s' % (e.__class__, e)594 traceback.print_exc()595 try:596 client.close()597 except:598 pass599 sys.exit(1)600elif filesystem == 3:601 # Here comes GlusterFS without redundancy602 # Get the first two instances. They will be the server603 zone = reservation.instances[0].placement604 instance_id1 = reservation.instances[0].id605 instance_id2 = reservation.instances[1].id606 print 607 608 try:609 # try to create the EBS volume610 neues_volume1 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)611 except EC2ResponseError:612 # An error occured613 print "While the system tried to create the EBS volume, an error occured." 614 else:615 print "The EBS volume "+neues_volume1.id+" was created successfully." 616 617 # Give the system some time to create the volume618 time.sleep(5)619 print620 621 try:622 # try to attach EBS volumne with the fist instance623 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume1.id, instance_id1, device)624 except EC2ResponseError:625 # An error occured626 print "While the system tried to attach the EBS volume with the instance "+str(instance_id1)+", an error occured." 627 else:628 print "Volume "+neues_volume1.id+" was attached with the instance "+str(instance_id1)+" successfully." 629 630 print631 632 try:633 # try to create the EBS volume634 neues_volume2 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)635 except EC2ResponseError:636 # An error occured637 print "While the system tried to create the EBS volume, an error occured." 638 else:639 print "The EBS volume "+neues_volume2.id+" was created successfully." 640 641 # Give the system some time to create the volume642 time.sleep(5)643 print644 645 try:646 # try to attach EBS volumne with the fist instance647 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume2.id, instance_id2, device)648 except EC2ResponseError:649 # An error occured650 print "While the system tried to attach the EBS volume with the instance "+str(instance_id2)+", an error occured." 651 else:652 print "Volume "+neues_volume2.id+" was attached with the instance "+str(instance_id2)+" successfully." 653 654 # Give the system some time to start the instances655 time.sleep(10)656 657 658 659 # Configuration of server660 for i in range(ANZ_Server):661 if i != ANZ_Server:662 try:663 # Upload of file glusterfs-3.0.5.tar.gz to the server 664 hostname = reservation.instances[i].public_dns_name665 666 transport = paramiko.Transport((hostname, port))667 transport.connect(username = username, pkey = key)668 669 sftp = paramiko.SFTPClient.from_transport(transport)670 671 remotepath = '/tmp/glusterfs-3.0.5.tar.gz'672 localpath = 'glusterfs-3.0.5.tar.gz'673 sftp.put(localpath, remotepath)674 675 sftp.close()676 transport.close()677 678 client = paramiko.SSHClient()679 client.load_system_host_keys()680 client.set_missing_host_key_policy(paramiko.WarningPolicy)681 # auto-accept unknown keys682 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())683 print 'Connecting...'684 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)685 chan = client.invoke_shell()686 print repr(client.get_transport())687 print 'The system creates the GlusterFS server.'688 print689 stdin, stdout, stderr = client.exec_command("sudo hostname")690 print stdout.readlines()691 print stderr.readlines()692 stdin, stdout, stderr = client.exec_command("sudo apt-get update")693 print stdout.readlines()694 print stderr.readlines()695 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install flex bison")696 print stdout.readlines()697 print stderr.readlines()698# stdin, stdout, stderr = client.exec_command("sudo wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.5.tar.gz -P /tmp/")699# print stdout.readlines()700# print stderr.readlines()701 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /tmp/glusterfs-3.0.5.tar.gz -C /tmp/")702 print stdout.readlines()703 print stderr.readlines()704 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; ./configure --prefix='")705 print stdout.readlines()706 print stderr.readlines()707 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make'")708 print stdout.readlines()709 print stderr.readlines()710 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make install'")711 print stdout.readlines()712 print stderr.readlines()713 stdin, stdout, stderr = client.exec_command("sudo ldconfig")714 print stdout.readlines()715 print stderr.readlines()716 stdin, stdout, stderr = client.exec_command("sudo glusterfs --version")717 print stdout.readlines()718 print stderr.readlines()719 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'sudo echo y | mkfs.ext3 /dev/sdc'")720 print stdout.readlines()721 print stderr.readlines()722 stdin, stdout, stderr = client.exec_command("sudo chmod o+wx /etc/fstab")723 print stdout.readlines()724 print stderr.readlines()725 stdin, stdout, stderr = client.exec_command("sudo echo '/dev/sdc /gluster ext3 noatime 0 0' >> /etc/fstab")726 print stdout.readlines()727 print stderr.readlines()728 stdin, stdout, stderr = client.exec_command("sudo chmod o-wx /etc/fstab")729 print stdout.readlines()730 print stderr.readlines()731 stdin, stdout, stderr = client.exec_command("sudo mkdir /gluster")732 print stdout.readlines()733 print stderr.readlines()734 stdin, stdout, stderr = client.exec_command("sudo mount /gluster")735 print stdout.readlines()736 print stderr.readlines()737 stdin, stdout, stderr = client.exec_command("sudo mkdir /gluster/export")738 print stdout.readlines()739 print stderr.readlines()740 741 liste_der_maschinen = ""742 743 for i in range(ANZ_Server):744 if i != ANZ_Server:745 liste_der_maschinen = liste_der_maschinen + reservation.instances[i].public_dns_name+":/gluster/export "746 747 stdin, stdout, stderr = client.exec_command("sudo glusterfs-volgen --name store1 "+liste_der_maschinen)748 print stdout.readlines()749 print stderr.readlines()750 751 vol_datename = reservation.instances[i].public_dns_name+"-store1-export.vol"752 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp "+vol_datename+" /etc/glusterfs/glusterfsd.vol'")753 print stdout.readlines()754 print stderr.readlines()755 756 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp store1-tcp.vol /etc/glusterfs/glusterfs.vol'")757 print stdout.readlines()758 print stderr.readlines()759 stdin, stdout, stderr = client.exec_command("sudo glusterfsd -f /etc/glusterfs/glusterfsd.vol")760 print stdout.readlines()761 print stderr.readlines()762 stdin, stdout, stderr = client.exec_command("sudo ps -aux | grep gluster")763 print stdout.readlines()764 print stderr.readlines()765 chan.close()766 client.close()767 768 except Exception, e:769 print '*** Caught exception: %s: %s' % (e.__class__, e)770 traceback.print_exc()771 try:772 client.close()773 except:774 pass775 sys.exit(1)776 777 778 # Datei repstore1-tcp.vol vom 1.Server holen779 try:780 hostname = reservation.instances[0].public_dns_name781 transport = paramiko.Transport((hostname, port))782 transport.connect(username = username, pkey = key)783 784 sftp = paramiko.SFTPClient.from_transport(transport)785 786 filepath = '/etc/glusterfs/glusterfs.vol'787 localpath = 'glusterfs.vol'788 sftp.get(filepath, localpath)789 790 sftp.close()791 transport.close()792 793 except Exception, e:794 print '*** Caught exception: %s: %s' % (e.__class__, e)795 traceback.print_exc()796 try:797 client.close()798 except:799 pass800 sys.exit(1)801 802 803 # Deploy the client(s)804 for i in range(ANZ):805 if i == (ANZ-1):806 try:807 # Upload of file glusterfs-3.0.5.tar.gz to the client 808 hostname = reservation.instances[i].public_dns_name809 810 transport = paramiko.Transport((hostname, port))811 transport.connect(username = username, pkey = key)812 813 sftp = paramiko.SFTPClient.from_transport(transport)814 815 remotepath = '/tmp/glusterfs-3.0.5.tar.gz'816 localpath = 'glusterfs-3.0.5.tar.gz'817 sftp.put(localpath, remotepath)818 819 sftp.close()820 transport.close()821 822 client = paramiko.SSHClient()823 client.load_system_host_keys()824 client.set_missing_host_key_policy(paramiko.WarningPolicy)825 # auto-accept unknown keys826 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())827 print 'Connecting...'828 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)829 chan = client.invoke_shell()830 print repr(client.get_transport())831 print 'The system creates the GlusterFS clients.'832 print833 stdin, stdout, stderr = client.exec_command("sudo hostname")834 print stdout.readlines()835 print stderr.readlines()836 stdin, stdout, stderr = client.exec_command("sudo apt-get update")837 print stdout.readlines()838 print stderr.readlines()839 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install flex bison")840 print stdout.readlines()841 print stderr.readlines()842# stdin, stdout, stderr = client.exec_command("sudo wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.5.tar.gz -P /tmp/")843# print stdout.readlines()844# print stderr.readlines()845 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /tmp/glusterfs-3.0.5.tar.gz -C /tmp/")846 print stdout.readlines()847 print stderr.readlines()848 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; ./configure --prefix='")849 print stdout.readlines()850 print stderr.readlines()851 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make'")852 print stdout.readlines()853 print stderr.readlines()854 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /tmp/glusterfs-3.0.5; make install'")855 print stdout.readlines()856 print stderr.readlines()857 stdin, stdout, stderr = client.exec_command("sudo ldconfig")858 print stdout.readlines()859 print stderr.readlines()860 stdin, stdout, stderr = client.exec_command("sudo glusterfs --version")861 print stdout.readlines()862 print stderr.readlines()863 stdin, stdout, stderr = client.exec_command("sudo modprobe fuse")864 print stdout.readlines()865 print stderr.readlines()866 stdin, stdout, stderr = client.exec_command("sudo mkdir /glusterfs")867 print stdout.readlines()868 print stderr.readlines()869 870 chan.close()871 client.close()872 873 # Datei repstore1-tcp.vol auf den Client hochladen 874 hostname = reservation.instances[i].public_dns_name875 876 transport = paramiko.Transport((hostname, port))877 transport.connect(username = username, pkey = key)878 879 sftp = paramiko.SFTPClient.from_transport(transport)880 881 remotepath = '/home/ubuntu/glusterfs.vol'882 localpath = 'glusterfs.vol'883 sftp.put(localpath, remotepath)884 885 sftp.close()886 transport.close()887 888 889 except Exception, e:890 print '*** Caught exception: %s: %s' % (e.__class__, e)891 traceback.print_exc()892 try:893 client.close()894 except:895 pass896 sys.exit(1)897 898 899 900 # Deploy the client(s)901 for i in range(ANZ):902 if i == (ANZ-1):903 try:904 client = paramiko.SSHClient()905 client.load_system_host_keys()906 client.set_missing_host_key_policy(paramiko.WarningPolicy)907 # auto-accept unknown keys908 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())909 print 'Connecting...'910 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)911 chan = client.invoke_shell()912 print repr(client.get_transport())913 print 'The system creates the GlusterFS clients.'914 print915 stdin, stdout, stderr = client.exec_command("sudo hostname")916 print stdout.readlines()917 print stderr.readlines()918 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cp glusterfs.vol /etc/glusterfs/'")919 print stdout.readlines()920 print stderr.readlines()921 stdin, stdout, stderr = client.exec_command("sudo mount -t glusterfs /etc/glusterfs/glusterfs.vol /glusterfs")922 print stdout.readlines()923 print stderr.readlines()924 stdin, stdout, stderr = client.exec_command("sudo df")925 print stdout.readlines()926 print stderr.readlines()927 stdin, stdout, stderr = client.exec_command("sudo tail /var/log/glusterfs/glusterfs.log")928 print stdout.readlines()929 print stderr.readlines()930 chan.close()931 client.close()932 933 except Exception, e:934 print '*** Caught exception: %s: %s' % (e.__class__, e)935 traceback.print_exc()936 try:937 client.close()938 except:939 pass940 sys.exit(1)941elif filesystem == 4:942 # Here comes GlusterFS with redundancy943 944 # Get the first two instances. They will be the server945 zone = reservation.instances[0].placement946 instance_id1 = reservation.instances[0].id947 instance_id2 = reservation.instances[1].id948 print 949 950 try:951 # try to create the EBS volume952 neues_volume1 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)953 except EC2ResponseError:954 # An error occured955 print "While the system tried to create the EBS volume, an error occured." 956 else:957 print "The EBS volume "+neues_volume1.id+" was created successfully." 958 959 # Give the system some time to create the volume960 time.sleep(5)961 print962 963 try:964 # try to attach EBS volumne with the fist instance965 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume1.id, instance_id1, device)966 except EC2ResponseError:967 # An error occured968 print "While the system tried to attach the EBS volume with the instance "+str(instance_id1)+", an error occured." 969 else:970 print "Volume "+neues_volume1.id+" was attached with the instance "+str(instance_id1)+" successfully." 971 972 print973 974 try:975 # try to create the EBS volume976 neues_volume2 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)977 except EC2ResponseError:978 # An error occured979 print "While the system tried to create the EBS volume, an error occured." 980 else:981 print "The EBS volume "+neues_volume2.id+" was created successfully." 982 983 # Give the system some time to create the volume984 time.sleep(5)985 print986 987 try:988 # try to attach EBS volumne with the fist instance989 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume2.id, instance_id2, device)990 except EC2ResponseError:991 # An error occured992 print "While the system tried to attach the EBS volume with the instance "+str(instance_id2)+", an error occured." 993 else:994 print "Volume "+neues_volume2.id+" was attached with the instance "+str(instance_id2)+" successfully." 995 996 # Give the system some time to start the instances997 time.sleep(10)998 # Configuratin of server999 for i in range(ANZ_Server):1000 if i != ANZ_Server:1001 try:1002 client = paramiko.SSHClient()1003 client.load_system_host_keys()1004 client.set_missing_host_key_policy(paramiko.WarningPolicy)1005 # auto-accept unknown keys1006 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())1007 print 'Connecting...'1008 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)1009 chan = client.invoke_shell()1010 print repr(client.get_transport())1011 print 'The system creates the Ceph server.'1012 print1013 stdin, stdout, stderr = client.exec_command("sudo hostname")1014 print stdout.readlines()1015 print stderr.readlines()1016 stdin, stdout, stderr = client.exec_command("sudo apt-get update")1017 print stdout.readlines()1018 print stderr.readlines()1019 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install git-core autoconf libtool libboost-dev libedit-dev libssl-dev libboost-all-dev")1020 print stdout.readlines()1021 print stderr.readlines()1022 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install btrfs-tools")1023 print stdout.readlines()1024 print stderr.readlines()1025 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install libfuse2 libfuse-dev gawk linux-ec2-source-2.6.32")1026 print stdout.readlines()1027 print stderr.readlines()1028 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install linux-headers-2.6.32-305-ec2 linux-image-2.6.32-305-ec2")1029 print stdout.readlines()1030 print stderr.readlines()1031 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /usr/src/linux-ec2-source-2.6.32.tar.bz2 -C /usr/src")1032 print stdout.readlines()1033 print stderr.readlines()1034 stdin, stdout, stderr = client.exec_command("sudo ln -s /usr/src/linux-ec2-source-2.6.32 /usr/src/linux")1035 print stdout.readlines()1036 print stderr.readlines()1037 stdin, stdout, stderr = client.exec_command("sudo cp /boot/config-2.6.32-305-ec2 /usr/src/linux/.config")1038 print stdout.readlines()1039 print stderr.readlines()1040 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/linux; make archprepare && make scripts && make prepare && make modules_prepare'")1041 print stdout.readlines()1042 print stderr.readlines()1043 stdin, stdout, stderr = client.exec_command("sudo cp /usr/src/linux-headers-2.6.32-305-ec2/Module.symvers /usr/src/linux/")1044 print stdout.readlines()1045 print stderr.readlines()1046 stdin, stdout, stderr = client.exec_command("sudo wget http://ceph.newdream.net/download/ceph-0.20.tar.gz")1047 print stdout.readlines()1048 print stderr.readlines()1049 stdin, stdout, stderr = client.exec_command("sudo wget http://ceph.newdream.net/download/ceph-kclient-0.20.tar.gz")1050 print stdout.readlines()1051 print stderr.readlines()1052 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf ceph-0.20.tar.gz")1053 print stdout.readlines()1054 print stderr.readlines()1055 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-0.20; ./autogen.sh'")1056 print stdout.readlines()1057 print stderr.readlines()1058 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-0.20; ./configure'")1059 print stdout.readlines()1060 print stderr.readlines()1061 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-0.20/src; make'")1062 print stdout.readlines()1063 print stderr.readlines()1064 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-0.20/src; make install'")1065 print stdout.readlines()1066 print stderr.readlines()1067 stdin, stdout, stderr = client.exec_command("sudo mkdir /var/log/ceph")1068 print stdout.readlines()1069 print stderr.readlines()1070 stdin, stdout, stderr = client.exec_command("sudo mkdir /etc/ceph")1071 print stdout.readlines()1072 print stderr.readlines()1073 stdin, stdout, stderr = client.exec_command("sudo touch /etc/ceph/ceph.conf")1074 print stdout.readlines()1075 print stderr.readlines()1076 stdin, stdout, stderr = client.exec_command("sudo chmod o+wx /etc/ceph/ceph.conf")1077 print stdout.readlines()1078 print stderr.readlines()1079 stdin, stdout, stderr = client.exec_command("sudo echo '[global]' >> /etc/ceph/ceph.conf")1080 print stdout.readlines()1081 print stderr.readlines()1082 stdin, stdout, stderr = client.exec_command("sudo echo ' pid file = /var/run/ceph/$name.pid' >> /etc/ceph/ceph.conf")1083 print stdout.readlines()1084 print stderr.readlines()1085 stdin, stdout, stderr = client.exec_command("sudo echo ' debug ms = 1' >> /etc/ceph/ceph.conf")1086 print stdout.readlines()1087 print stderr.readlines()1088 stdin, stdout, stderr = client.exec_command("sudo echo '[mon]' >> /etc/ceph/ceph.conf")1089 print stdout.readlines()1090 print stderr.readlines()1091 stdin, stdout, stderr = client.exec_command("sudo echo ' mon data = /srv/ceph/mon' >> /etc/ceph/ceph.conf")1092 print stdout.readlines()1093 print stderr.readlines()1094 stdin, stdout, stderr = client.exec_command("sudo echo '[mon0]' >> /etc/ceph/ceph.conf")1095 print stdout.readlines()1096 print stderr.readlines()1097 stdin, stdout, stderr = client.exec_command("sudo echo ' host = "+reservation.instances[0].private_dns_name+"' >> /etc/ceph/ceph.conf")1098 print stdout.readlines()1099 print stderr.readlines()1100 stdin, stdout, stderr = client.exec_command("sudo echo ' mon addr = "+reservation.instances[0].private_dns_name+":6789' >> /etc/ceph/ceph.conf")1101 print stdout.readlines()1102 print stderr.readlines()1103 stdin, stdout, stderr = client.exec_command("sudo echo '[mds]' >> /etc/ceph/ceph.conf")1104 print stdout.readlines()1105 print stderr.readlines()1106 stdin, stdout, stderr = client.exec_command("sudo echo '[mds0]' >> /etc/ceph/ceph.conf")1107 print stdout.readlines()1108 print stderr.readlines()1109 stdin, stdout, stderr = client.exec_command("sudo echo ' host = "+reservation.instances[0].private_dns_name+"' >> /etc/ceph/ceph.conf")1110 print stdout.readlines()1111 print stderr.readlines()1112 stdin, stdout, stderr = client.exec_command("sudo echo '[osd]' >> /etc/ceph/ceph.conf")1113 print stdout.readlines()1114 print stderr.readlines()1115 stdin, stdout, stderr = client.exec_command("sudo echo ' sudo = true' >> /etc/ceph/ceph.conf")1116 print stdout.readlines()1117 print stderr.readlines()1118 stdin, stdout, stderr = client.exec_command("sudo echo ' osd data = /data/osd' >> /etc/ceph/ceph.conf")1119 print stdout.readlines()1120 print stderr.readlines()1121 stdin, stdout, stderr = client.exec_command("sudo echo '[osd0]' >> /etc/ceph/ceph.conf")1122 print stdout.readlines()1123 print stderr.readlines()1124 stdin, stdout, stderr = client.exec_command("sudo echo ' host = "+reservation.instances[0].private_dns_name+"' >> /etc/ceph/ceph.conf")1125 print stdout.readlines()1126 print stderr.readlines()1127 stdin, stdout, stderr = client.exec_command("sudo echo ' btrfs devs = /dev/sdc' >> /etc/ceph/ceph.conf")1128 print stdout.readlines()1129 print stderr.readlines()1130 stdin, stdout, stderr = client.exec_command("sudo echo '[osd1]' >> /etc/ceph/ceph.conf")1131 print stdout.readlines()1132 print stderr.readlines()1133 stdin, stdout, stderr = client.exec_command("sudo echo ' host = "+reservation.instances[1].private_dns_name+"' >> /etc/ceph/ceph.conf")1134 print stdout.readlines()1135 print stderr.readlines()1136 stdin, stdout, stderr = client.exec_command("sudo echo ' btrfs devs = /dev/sdc' >> /etc/ceph/ceph.conf")1137 print stdout.readlines()1138 print stderr.readlines()1139 stdin, stdout, stderr = client.exec_command("sudo cat /etc/ceph/ceph.conf")1140 print stdout.readlines()1141 print stderr.readlines()1142 stdin, stdout, stderr = client.exec_command("sudo chmod o-wx /etc/ceph/ceph.conf")1143 print stdout.readlines()1144 print stderr.readlines()1145 stdin, stdout, stderr = client.exec_command("sudo mkcephfs -c /etc/ceph/ceph.conf --allhosts --mkbtrfs -k ~/admin.keyring")1146 print stdout.readlines()1147 print stderr.readlines()1148 stdin, stdout, stderr = client.exec_command("sudo cp ceph-0.20/src/init-ceph /etc/init.d/ceph")1149 print stdout.readlines()1150 print stderr.readlines()1151 stdin, stdout, stderr = client.exec_command("sudo chmod a+x /etc/init.d/ceph")1152 print stdout.readlines()1153 print stderr.readlines()1154 stdin, stdout, stderr = client.exec_command("sudo chmod u+w /etc/init.d/ceph")1155 print stdout.readlines()1156 print stderr.readlines()1157 stdin, stdout, stderr = client.exec_command("sudo /etc/init.d/ceph -c /etc/ceph/ceph.conf start")1158 print stdout.readlines()1159 print stderr.readlines()1160 stdin, stdout, stderr = client.exec_command("sudo ps -aux | grep ceph")1161 print stdout.readlines()1162 print stderr.readlines()1163 chan.close()1164 client.close()1165 1166 except Exception, e:1167 print '*** Caught exception: %s: %s' % (e.__class__, e)1168 traceback.print_exc()1169 try:1170 client.close()1171 except:1172 pass1173 sys.exit(1)1174 1175 1176 # Deploy the client(s)1177 for i in range(ANZ):1178 if i == (ANZ-1):1179 try:1180 client = paramiko.SSHClient()1181 client.load_system_host_keys()1182 client.set_missing_host_key_policy(paramiko.WarningPolicy)1183 # auto-accept unknown keys1184 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())1185 print 'Connecting...'1186 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)1187 chan = client.invoke_shell()1188 print repr(client.get_transport())1189 print 'The system creates the GlusterFS clients.'1190 print1191 stdin, stdout, stderr = client.exec_command("sudo hostname")1192 print stdout.readlines()1193 print stderr.readlines()1194 stdin, stdout, stderr = client.exec_command("sudo apt-get update")1195 print stdout.readlines()1196 print stderr.readlines()1197 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install autoconf libtool libboost-dev libedit-dev libssl-dev libboost-all-dev")1198 print stdout.readlines()1199 print stderr.readlines()1200 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install btrfs-tools")1201 print stdout.readlines()1202 print stderr.readlines()1203 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install libfuse2 libfuse-dev gawk linux-ec2-source-2.6.32")1204 print stdout.readlines()1205 print stderr.readlines()1206 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install linux-headers-2.6.32-305-ec2 linux-image-2.6.32-305-ec2")1207 print stdout.readlines()1208 print stderr.readlines()1209 stdin, stdout, stderr = client.exec_command("sudo tar -xvjf /usr/src/linux-ec2-source-2.6.32.tar.bz2 -C /usr/src")1210 print stdout.readlines()1211 print stderr.readlines()1212 stdin, stdout, stderr = client.exec_command("sudo ln -s /usr/src/linux-ec2-source-2.6.32 /usr/src/linux")1213 print stdout.readlines()1214 print stderr.readlines()1215 stdin, stdout, stderr = client.exec_command("sudo cp /boot/config-2.6.32-305-ec2 /usr/src/linux/.config")1216 print stdout.readlines()1217 print stderr.readlines()1218 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/linux; make archprepare && make scripts && make prepare && make modules_prepare'")1219 print stdout.readlines()1220 print stderr.readlines()1221 stdin, stdout, stderr = client.exec_command("sudo cp /usr/src/linux-headers-2.6.32-305-ec2/Module.symvers /usr/src/linux/")1222 print stdout.readlines()1223 print stderr.readlines()1224 stdin, stdout, stderr = client.exec_command("sudo wget http://ceph.newdream.net/download/ceph-kclient-0.20.tar.gz")1225 print stdout.readlines()1226 print stderr.readlines()1227 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf ceph-kclient-0.20.tar.gz")1228 print stdout.readlines()1229 print stderr.readlines()1230 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-kclient-0.20; make KERNELDIR=/usr/src/linux/'")1231 print stdout.readlines()1232 print stderr.readlines()1233 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd ceph-kclient-0.20; make modules_install'")1234 print stdout.readlines()1235 print stderr.readlines()1236 stdin, stdout, stderr = client.exec_command("sudo depmod")1237 print stdout.readlines()1238 print stderr.readlines()1239 stdin, stdout, stderr = client.exec_command("sudo modprobe ceph")1240 print stdout.readlines()1241 print stderr.readlines()1242 stdin, stdout, stderr = client.exec_command("sudo lsmod | grep ceph")1243 print stdout.readlines()1244 print stderr.readlines()1245 stdin, stdout, stderr = client.exec_command("sudo mkdir /mnt/ceph")1246 print stdout.readlines()1247 print stderr.readlines()1248 stdin, stdout, stderr = client.exec_command("sudo mount -t ceph "+ reservation.instances[0].private_dns_name+":/ /mnt/ceph/")1249 print stdout.readlines()1250 print stderr.readlines()1251 chan.close()1252 client.close()1253 1254 1255 except Exception, e:1256 print '*** Caught exception: %s: %s' % (e.__class__, e)1257 traceback.print_exc()1258 try:1259 client.close()1260 except:1261 pass1262 sys.exit(1)1263elif filesystem == 5:1264 # Here comes PVFS2 without redundancy1265 # Get the first two instances. They will be the server1266 zone = reservation.instances[0].placement1267 instance_id1 = reservation.instances[0].id1268 instance_id2 = reservation.instances[1].id1269 print 1270 1271 try:1272 # try to create the EBS volume1273 neues_volume1 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)1274 except EC2ResponseError:1275 # An error occured1276 print "While the system tried to create the EBS volume, an error occured." 1277 else:1278 print "The EBS volume "+neues_volume1.id+" was created successfully." 1279 1280 # Give the system some time to create the volume1281 time.sleep(5)1282 print1283 1284 try:1285 # try to attach EBS volumne with the fist instance1286 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume1.id, instance_id1, device)1287 except EC2ResponseError:1288 # An error occured1289 print "While the system tried to attach the EBS volume with the instance "+str(instance_id1)+", an error occured." 1290 else:1291 print "Volume "+neues_volume1.id+" was attached with the instance "+str(instance_id1)+" successfully." 1292 1293 print1294 1295 try:1296 # try to create the EBS volume1297 neues_volume2 = conn_us_east.create_volume(EBS_Size, zone, snapshot=None)1298 except EC2ResponseError:1299 # An error occured1300 print "While the system tried to create the EBS volume, an error occured." 1301 else:1302 print "The EBS volume "+neues_volume2.id+" was created successfully." 1303 1304 # Give the system some time to create the volume1305 time.sleep(5)1306 print1307 1308 try:1309 # try to attach EBS volumne with the fist instance1310 neues_volume_anhaengen = conn_us_east.attach_volume(neues_volume2.id, instance_id2, device)1311 except EC2ResponseError:1312 # An error occured1313 print "While the system tried to attach the EBS volume with the instance "+str(instance_id2)+", an error occured." 1314 else:1315 print "Volume "+neues_volume2.id+" was attached with the instance "+str(instance_id2)+" successfully." 1316 1317 # Give the system some time to start the instances1318 time.sleep(10)1319 1320 1321 1322 # Configuration of PVFS2 server1323 for i in range(ANZ_Server):1324 if i != ANZ_Server:1325 try:1326 client = paramiko.SSHClient()1327 client.load_system_host_keys()1328 client.set_missing_host_key_policy(paramiko.WarningPolicy)1329 # auto-accept unknown keys1330 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())1331 print 'Connecting...'1332 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)1333 chan = client.invoke_shell()1334 print repr(client.get_transport())1335 print 'Deploy server'1336 print1337 stdin, stdout, stderr = client.exec_command("sudo hostname")1338 print stdout.readlines()1339 print stderr.readlines()1340 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'sudo echo y | mkfs.ext3 /dev/sdc'")1341 print stdout.readlines()1342 print stderr.readlines()1343 stdin, stdout, stderr = client.exec_command("sudo mkdir /pvfs2-storage-space")1344 print stdout.readlines()1345 print stderr.readlines()1346 #stdin, stdout, stderr = client.exec_command("sudo mkdir /mnt/pvfs2/")1347 #print stdout.readlines()1348 #print stderr.readlines()1349 stdin, stdout, stderr = client.exec_command("sudo mount /dev/sdc /pvfs2-storage-space")1350 print stdout.readlines()1351 print stderr.readlines()1352 stdin, stdout, stderr = client.exec_command("sudo apt-get update")1353 print stdout.readlines()1354 print stderr.readlines()1355 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install joe bonnie++ gcc-4.4 g++ db4.8-util libdb4.8 libdb4.8-dev libdb-dev db4.8-util linux-headers-2.6.32-305-ec2 linux-image-2.6.32-305-ec2")1356 print stdout.readlines()1357 print stderr.readlines()1358 stdin, stdout, stderr = client.exec_command("sudo wget ftp://ftp.parl.clemson.edu/pub/pvfs2/pvfs-2.8.2.tar.gz -P /usr/src/")1359 print stdout.readlines()1360 print stderr.readlines()1361 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /usr/src/pvfs-2.8.2.tar.gz -C /usr/src")1362 print stdout.readlines()1363 print stderr.readlines()1364 stdin, stdout, stderr = client.exec_command("sudo ln -s /usr/src/pvfs-2.8.2 /usr/src/pvfs2")1365 print stdout.readlines()1366 print stderr.readlines()1367 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; ./configure --with-kernel=/lib/modules/`uname -r`/build'")1368 print stdout.readlines()1369 print stderr.readlines()1370 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; make'")1371 print stdout.readlines()1372 print stderr.readlines()1373 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; make install'")1374 print stdout.readlines()1375 print stderr.readlines()1376 1377 instance0_hostname = str(reservation.instances[0].private_dns_name).replace('.ec2.internal', '')1378 instance1_hostname = str(reservation.instances[1].private_dns_name).replace('.ec2.internal', '')1379 print "Hostname 0:", str(instance0_hostname)1380 print "Hostname 1:", str(instance1_hostname)1381 1382 stdin, stdout, stderr = client.exec_command("sudo pvfs2-genconfig --protocol tcp --tcpport 3334 --storage /pvfs2-storage-space --logfile /tmp/pvfs2-server.log --ioservers "+instance0_hostname+","+instance1_hostname+" --metaservers "+instance0_hostname+","+instance1_hostname+" /etc/pvfs2-fs.conf --quiet")1383 print stdout.readlines()1384 print stderr.readlines()1385 1386 1387 if i == 0:1388 # Datei pvfs2-fs.conf vom 1.Server holen1389 hostname = reservation.instances[0].public_dns_name1390 transport = paramiko.Transport((hostname, port))1391 transport.connect(username = username, pkey = key)1392 1393 sftp = paramiko.SFTPClient.from_transport(transport)1394 1395 filepath = '/etc/pvfs2-fs.conf'1396 localpath = 'pvfs2-fs.conf'1397 sftp.get(filepath, localpath)1398 1399 sftp.close()1400 transport.close()1401 else:1402 # Datei pvfs2-fs.conf auf die anderen Server hochladen 1403 hostname = reservation.instances[i].public_dns_name1404 transport = paramiko.Transport((hostname, port))1405 transport.connect(username = username, pkey = key)1406 1407 sftp = paramiko.SFTPClient.from_transport(transport)1408 1409 remotepath = '/home/ubuntu/pvfs2-fs.conf'1410 localpath = 'pvfs2-fs.conf'1411 sftp.put(localpath, remotepath)1412 1413 sftp.close()1414 transport.close()1415 1416 if i != 0:1417 stdin, stdout, stderr = client.exec_command("sudo mv /home/ubuntu/pvfs2-fs.conf /etc/pvfs2-fs.conf")1418 print stdout.readlines()1419 print stderr.readlines()1420 1421 stdin, stdout, stderr = client.exec_command("sudo pvfs2-server /etc/pvfs2-fs.conf -f")1422 print stdout.readlines()1423 print stderr.readlines()1424 stdin, stdout, stderr = client.exec_command("sudo pvfs2-server /etc/pvfs2-fs.conf")1425 print stdout.readlines()1426 print stderr.readlines()1427 stdin, stdout, stderr = client.exec_command("sudo mkdir /mnt/pvfs2")1428 print stdout.readlines()1429 print stderr.readlines()1430 stdin, stdout, stderr = client.exec_command("sudo chmod o+wx /etc/fstab")1431 print stdout.readlines()1432 print stderr.readlines()1433 stdin, stdout, stderr = client.exec_command("sudo echo 'tcp://"+instance0_hostname+":3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0' >> /etc/fstab ")1434 print stdout.readlines()1435 print stderr.readlines()1436 stdin, stdout, stderr = client.exec_command("sudo chmod o-wx /etc/fstab")1437 print stdout.readlines()1438 print stderr.readlines()1439 stdin, stdout, stderr = client.exec_command("sudo touch /etc/pvfs2tab")1440 print stdout.readlines()1441 print stderr.readlines()1442 stdin, stdout, stderr = client.exec_command("sudo chmod a+r /etc/pvfs2tab")1443 print stdout.readlines()1444 print stderr.readlines()1445 stdin, stdout, stderr = client.exec_command("sudo chmod o+wx /etc/pvfs2tab")1446 print stdout.readlines()1447 print stderr.readlines()1448 stdin, stdout, stderr = client.exec_command("sudo echo 'tcp://"+instance0_hostname+":3334/pvfs2-fs /mnt/pvfs2 pvfs2 defaults,noauto 0 0' >> /etc/pvfs2tab ")1449 stdin, stdout, stderr = client.exec_command("sudo chmod o-wx /etc/pvfs2tab")1450 print stdout.readlines()1451 print stderr.readlines()1452 chan.close()1453 client.close()1454 1455 1456 except Exception, e:1457 print '*** Caught exception: %s: %s' % (e.__class__, e)1458 traceback.print_exc()1459 try:1460 client.close()1461 except:1462 pass1463 sys.exit(1)1464 1465 # Deploy PVFS2 Client(s)1466 for i in range(ANZ):1467 if i == (ANZ-1):1468 try:1469 client = paramiko.SSHClient()1470 client.load_system_host_keys()1471 client.set_missing_host_key_policy(paramiko.WarningPolicy)1472 # auto-accept unknown keys1473 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())1474 print 'Connecting...'1475 client.connect(reservation.instances[i].public_dns_name, port, username, password, key)1476 chan = client.invoke_shell()1477 print repr(client.get_transport())1478 print 'Deploy PVFS2 client(s)'1479 print1480 stdin, stdout, stderr = client.exec_command("sudo hostname")1481 print stdout.readlines()1482 print stderr.readlines()1483 stdin, stdout, stderr = client.exec_command("sudo apt-get update")1484 print stdout.readlines()1485 print stderr.readlines()1486 stdin, stdout, stderr = client.exec_command("sudo apt-get -y install joe bonnie++ gcc-4.4 g++ db4.8-util libdb4.8 libdb4.8-dev libdb-dev db4.8-util linux-headers-2.6.32-305-ec2 linux-image-2.6.32-305-ec2 gawk linux-ec2-source-2.6.32")1487 print stdout.readlines()1488 print stderr.readlines()1489 stdin, stdout, stderr = client.exec_command("sudo wget http://archive.ubuntu.com/ubuntu/pool/multiverse/i/iozone3/iozone3_308-1ubuntu0.1_i386.deb")1490 print stdout.readlines()1491 print stderr.readlines()1492 stdin, stdout, stderr = client.exec_command("sudo dpkg -i iozone3_308-1ubuntu0.1_i386.deb")1493 print stdout.readlines()1494 print stderr.readlines()1495 stdin, stdout, stderr = client.exec_command("sudo wget ftp://ftp.parl.clemson.edu/pub/pvfs2/pvfs-2.8.2.tar.gz -P /usr/src/")1496 print stdout.readlines()1497 print stderr.readlines()1498 stdin, stdout, stderr = client.exec_command("sudo tar -xvzf /usr/src/pvfs-2.8.2.tar.gz -C /usr/src")1499 print stdout.readlines()1500 print stderr.readlines()1501 stdin, stdout, stderr = client.exec_command("sudo ln -s /usr/src/pvfs-2.8.2 /usr/src/pvfs2")1502 print stdout.readlines()1503 print stderr.readlines()1504 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; ./configure --with-kernel=/lib/modules/`uname -r`/build'")1505 print stdout.readlines()1506 print stderr.readlines()1507 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; make'")1508 print stdout.readlines()1509 print stderr.readlines()1510 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2; make install'")1511 print stdout.readlines()1512 print stderr.readlines()1513 stdin, stdout, stderr = client.exec_command("sudo mkdir /mnt/pvfs2/")1514 print stdout.readlines()1515 print stderr.readlines()1516 #stdin, stdout, stderr = client.exec_command("sudo touch /etc/pvfs2tab")1517 #print stdout.readlines()1518 #print stderr.readlines()1519 #stdin, stdout, stderr = client.exec_command("sudo chmod a+r /etc/pvfs2tab")1520 #print stdout.readlines()1521 #print stderr.readlines()1522 stdin, stdout, stderr = client.exec_command("sudo tar -xvjf /usr/src/linux-ec2-source-2.6.32.tar.bz2 -C /usr/src")1523 print stdout.readlines()1524 print stderr.readlines()1525 stdin, stdout, stderr = client.exec_command("sudo ln -s /usr/src/linux-ec2-source-2.6.32 /usr/src/linux")1526 print stdout.readlines()1527 print stderr.readlines()1528 stdin, stdout, stderr = client.exec_command("sudo cp /boot/config-2.6.32-305-ec2 /usr/src/linux/.config")1529 print stdout.readlines()1530 print stderr.readlines()1531 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/linux/; make archprepare && make scripts && make prepare && make modules_prepare'")1532 print stdout.readlines()1533 print stderr.readlines()1534 stdin, stdout, stderr = client.exec_command("sudo cp /usr/src/linux-headers-2.6.32-305-ec2/Module.symvers /usr/src/linux/")1535 print stdout.readlines()1536 print stderr.readlines()1537 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2/; ./configure --with-kernel=/usr/src/linux/'")1538 print stdout.readlines()1539 print stderr.readlines()1540 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2/; make kmod'")1541 print stdout.readlines()1542 print stderr.readlines()1543 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2/; make kmod_install'")1544 print stdout.readlines()1545 print stderr.readlines()1546 stdin, stdout, stderr = client.exec_command("sudo insmod /usr/src/pvfs2/src/kernel/linux-2.6/pvfs2.ko")1547 print stdout.readlines()1548 print stderr.readlines()1549 stdin, stdout, stderr = client.exec_command("sudo lsmod")1550 print stdout.readlines()1551 print stderr.readlines()1552 stdin, stdout, stderr = client.exec_command("sudo /bin/sh -c 'cd /usr/src/pvfs2/src/apps/kernel/linux/; ./pvfs2-client -p ./pvfs2-client-core'")1553 print stdout.readlines()1554 print stderr.readlines()1555 stdin, stdout, stderr = client.exec_command("sudo mount -t pvfs2 tcp://"+instance0_hostname+":3334/pvfs2-fs /mnt/pvfs2")1556 print stdout.readlines()1557 print stderr.readlines()1558 stdin, stdout, stderr = client.exec_command("sudo mount | grep pvfs2")1559 print stdout.readlines()1560 print stderr.readlines()1561 chan.close()1562 client.close()1563 1564 1565 except Exception, e:1566 print '*** Caught exception: %s: %s' % (e.__class__, e)1567 traceback.print_exc()1568 try:1569 client.close()1570 except:1571 pass1572 sys.exit(1) 1573 1574 ...

Full Screen

Full Screen

CreateHeader.py

Source:CreateHeader.py Github

copy

Full Screen

1import os2import re3import codecs4def isValidLine(line):5 if re.search('include \"', line) == None or line.find('.PSVita') != -1 or line.find('.PS4') != -1 or line.find('.Switch') != -1 or line.find('.XBoxOne') != -1:6 return True7 return False8class CreateHeader:9 def __init__(self):10 self.lines = []11 def addLine(self,line):12 self.lines.append(line)13 def readLines(self,path):14 f = codecs.open(path, 'r','utf-8_sig')15 line = f.readline()16 while line:17 if isValidLine(line):18 self.lines.append(line.strip(os.linesep))19 line = f.readline()20 f.close()21 def output(self,path):22 f = codecs.open(path, 'w','utf-8_sig')23 for line in self.lines:24 f.write(line + os.linesep)25 f.close()26effekseerHeader = CreateHeader()27effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Base.Pre.h')28effekseerHeader.readLines('Effekseer/Effekseer/Utils/Effekseer.CustomAllocator.h')29effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Vector2D.h')30effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Vector3D.h')31effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Color.h')32effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.RectF.h')33effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Matrix43.h')34effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Matrix44.h')35effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.File.h')36effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.DefaultFile.h')37effekseerHeader.readLines('Effekseer/Effekseer/Backend/GraphicsDevice.h')38effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Resource.h')39effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Effect.h')40effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Manager.h')41effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Setting.h')42effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Server.h')43effekseerHeader.readLines('Effekseer/Effekseer/Effekseer.Client.h')44effekseerHeader.addLine('')45effekseerHeader.addLine('#include "Effekseer.Modules.h"')46effekseerHeader.addLine('')47effekseerHeader.output('Effekseer/Effekseer.h')48effekseerSimdHeader = CreateHeader()49effekseerSimdHeader.addLine('#pragma once')50effekseerSimdHeader.addLine('#include "Effekseer.h"')51effekseerSimdHeader.addLine('')52effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Base.h')53effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Float4_Gen.h')54effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Float4_NEON.h')55effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Float4_SSE.h')56effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Int4_Gen.h')57effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Int4_NEON.h')58effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Int4_SSE.h')59effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Bridge_Gen.h')60effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Bridge_NEON.h')61effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Bridge_SSE.h')62effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Vec2f.h')63effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Vec3f.h')64effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Vec4f.h')65effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Mat43f.h')66effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Mat44f.h')67effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Quaternionf.h')68effekseerSimdHeader.readLines('Effekseer/Effekseer/SIMD/Utils.h')69effekseerSimdHeader.output('Effekseer/Effekseer.SIMD.h')70effekseerModulesHeader = CreateHeader()71effekseerModulesHeader.addLine('#pragma once')72effekseerModulesHeader.addLine('')73effekseerModulesHeader.addLine('#include "Effekseer.h"')74effekseerModulesHeader.addLine('#include "Effekseer.SIMD.h"')75effekseerModulesHeader.addLine('')76effekseerModulesHeader.addLine('// A header to access internal data of effekseer')77effekseerModulesHeader.readLines('Effekseer/Effekseer/Parameter/Effekseer.Parameters.h')78effekseerModulesHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.SpriteRenderer.h')79effekseerModulesHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.RibbonRenderer.h')80effekseerModulesHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.RingRenderer.h')81effekseerModulesHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.ModelRenderer.h')82effekseerModulesHeader.readLines('Effekseer/Effekseer/Renderer/Effekseer.TrackRenderer.h')83effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.EffectLoader.h')84effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.TextureLoader.h')85effekseerModulesHeader.readLines('Effekseer/Effekseer/Model/Model.h')86effekseerModulesHeader.readLines('Effekseer/Effekseer/Model/ModelLoader.h')87effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.MaterialLoader.h')88effekseerModulesHeader.readLines('Effekseer/Effekseer/Model/Model.h')89effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.Curve.h')90effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.CurveLoader.h')91effekseerModulesHeader.readLines('Effekseer/Effekseer/Sound/Effekseer.SoundPlayer.h')92effekseerModulesHeader.readLines('Effekseer/Effekseer/Effekseer.SoundLoader.h')93effekseerModulesHeader.output('Effekseer/Effekseer.Modules.h')94effekseerRendererDX9Header = CreateHeader()95effekseerRendererDX9Header.readLines('EffekseerRendererDX9/EffekseerRenderer/EffekseerRendererDX9.Base.Pre.h')96effekseerRendererDX9Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')97effekseerRendererDX9Header.readLines('EffekseerRendererCommon/TextureLoader.h')98effekseerRendererDX9Header.readLines('EffekseerRendererDX9/EffekseerRenderer/EffekseerRendererDX9.Renderer.h')99effekseerRendererDX9Header.output('EffekseerRendererDX9/EffekseerRendererDX9.h')100effekseerRendererDX11Header = CreateHeader()101effekseerRendererDX11Header.readLines('EffekseerRendererDX11/EffekseerRenderer/EffekseerRendererDX11.Base.Pre.h')102effekseerRendererDX11Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')103effekseerRendererDX11Header.readLines('EffekseerRendererCommon/TextureLoader.h')104effekseerRendererDX11Header.readLines('EffekseerRendererDX11/EffekseerRenderer/EffekseerRendererDX11.Renderer.h')105effekseerRendererDX11Header.output('EffekseerRendererDX11/EffekseerRendererDX11.h')106effekseerRendererDX12Header = CreateHeader()107effekseerRendererDX12Header.readLines('EffekseerRendererDX12/EffekseerRenderer/EffekseerRendererDX12.Base.Pre.h')108effekseerRendererDX12Header.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')109effekseerRendererDX12Header.readLines('EffekseerRendererCommon/TextureLoader.h')110effekseerRendererDX12Header.readLines('EffekseerRendererDX12/EffekseerRenderer/EffekseerRendererDX12.Renderer.h')111effekseerRendererDX12Header.readLines('EffekseerRendererLLGI/Common.h')112effekseerRendererDX12Header.output('EffekseerRendererDX12/EffekseerRendererDX12.h')113effekseerRendererVulkanHeader = CreateHeader()114effekseerRendererVulkanHeader.readLines('EffekseerRendererVulkan/EffekseerRenderer/EffekseerRendererVulkan.Base.Pre.h')115effekseerRendererVulkanHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')116effekseerRendererVulkanHeader.readLines('EffekseerRendererCommon/TextureLoader.h')117effekseerRendererVulkanHeader.readLines('EffekseerRendererVulkan/EffekseerRenderer/EffekseerRendererVulkan.Renderer.h')118effekseerRendererVulkanHeader.readLines('EffekseerRendererLLGI/Common.h')119effekseerRendererVulkanHeader.output('EffekseerRendererVulkan/EffekseerRendererVulkan.h')120effekseerRendererGLHeader = CreateHeader()121effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Base.Pre.h')122effekseerRendererGLHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')123effekseerRendererGLHeader.readLines('EffekseerRendererCommon/TextureLoader.h')124effekseerRendererGLHeader.readLines('EffekseerRendererGL/EffekseerRenderer/EffekseerRendererGL.Renderer.h')125effekseerRendererGLHeader.output('EffekseerRendererGL/EffekseerRendererGL.h')126effekseerRendererMetalHeader = CreateHeader()127effekseerRendererMetalHeader.readLines('EffekseerRendererMetal/EffekseerRenderer/EffekseerRendererMetal.Base.Pre.h')128effekseerRendererMetalHeader.readLines('EffekseerRendererCommon/EffekseerRenderer.Renderer.h')129effekseerRendererMetalHeader.readLines('EffekseerRendererCommon/TextureLoader.h')130effekseerRendererMetalHeader.readLines('EffekseerRendererMetal/EffekseerRenderer/EffekseerRendererMetal.Renderer.h')131effekseerRendererMetalHeader.readLines('EffekseerRendererLLGI/Common.h')...

Full Screen

Full Screen

init.py

Source:init.py Github

copy

Full Screen

...27#s=SECTOR("-6P",fed,17,ccu,pxfec,caen)28s=GROUP(fed, ccu, pxfec, caen, "+6PL12", 0x11, log)29# print "FED slot ",s.fedslot30verbose = True31ccu.send("reset").readlines()32sleep(0.1)33ccu.send("scanccu").readlines()34ccu.send("piareset doh").readlines()35sleep(0.1)36ccu.send("piareset aoh").readlines()37sleep(0.1)38for l in ccu.send("scanccu").readlines():39 if (verbose): print l40ccu.send("fec 21").readlines()41ccu.send("ring 0x8").readlines()42ccu.send("ccu 0x7c").readlines()43ccu.send("channel 0x11").readlines()44ccu.send("delay25 init").readlines()45ccu.send("pll reset").readlines()46ccu.send("pll init").readlines()47ccu.send("doh init").readlines()48ccu.send("poh1 init").readlines()49ccu.send("poh2 init").readlines()50ccu.send("poh3 init").readlines()51ccu.send("poh4 init").readlines()52ccu.send("poh5 init").readlines()53ccu.send("poh6 init").readlines()54ccu.send("poh7 init").readlines()55#ccu.send("doh setall 3 3 3 40 40 40").readlines()56ccu.send("poh1 setall 3 3 3 3 40 40 40 40").readlines()57ccu.send("poh2 setall 3 3 3 3 40 40 40 40").readlines()58ccu.send("poh3 setall 3 3 3 3 40 40 40 40").readlines()59ccu.send("poh4 setall 3 3 3 3 40 40 40 40").readlines()60ccu.send("poh5 setall 3 3 3 3 40 40 40 40").readlines()61ccu.send("poh6 setall 3 3 3 3 40 40 40 40").readlines()62ccu.send("poh7 setall 3 3 3 3 40 40 40 40").readlines()63# ccu.send("poh1 setall 3 3 3 3 20 20 20 20").readlines()64# ccu.send("poh2 setall 3 3 3 3 20 20 20 20").readlines()65# ccu.send("poh3 setall 3 3 3 3 20 20 20 20").readlines()66# ccu.send("poh4 setall 3 3 3 3 20 20 20 20").readlines()67# ccu.send("poh5 setall 3 3 3 3 20 20 20 20").readlines()68# ccu.send("poh6 setall 3 3 3 3 20 20 20 20").readlines()69# ccu.send("poh7 setall 3 3 3 3 20 20 20 20").readlines()70ccu.send("channel 0x13").readlines()71ccu.send("delay25 init").readlines()72ccu.send("pll reset").readlines()73ccu.send("pll init").readlines()74ccu.send("doh init").readlines()75ccu.send("poh1 init").readlines()76ccu.send("poh2 init").readlines()77ccu.send("poh3 init").readlines()78ccu.send("poh4 init").readlines()79ccu.send("poh5 init").readlines()80ccu.send("poh6 init").readlines()81ccu.send("poh7 init").readlines()82#ccu.send("doh setall 3 3 3 40 40 40").readlines()83ccu.send("poh1 setall 3 3 3 3 40 40 40 40").readlines()84ccu.send("poh2 setall 3 3 3 3 40 40 40 40").readlines()85ccu.send("poh3 setall 3 3 3 3 40 40 40 40").readlines()86ccu.send("poh4 setall 3 3 3 3 40 40 40 40").readlines()87ccu.send("poh5 setall 3 3 3 3 40 40 40 40").readlines()88ccu.send("poh6 setall 3 3 3 3 40 40 40 40").readlines()89ccu.send("poh7 setall 3 3 3 3 40 40 40 40").readlines()90# ccu.send("poh1 setall 3 3 3 3 20 20 20 20").readlines()91# ccu.send("poh2 setall 3 3 3 3 20 20 20 20").readlines()92# ccu.send("poh3 setall 3 3 3 3 20 20 20 20").readlines()93# ccu.send("poh4 setall 3 3 3 3 20 20 20 20").readlines()94# ccu.send("poh5 setall 3 3 3 3 20 20 20 20").readlines()95# ccu.send("poh6 setall 3 3 3 3 20 20 20 20").readlines()96# ccu.send("poh7 setall 3 3 3 3 20 20 20 20").readlines()97ccu.close()...

Full Screen

Full Screen

SplitClusters.py

Source:SplitClusters.py Github

copy

Full Screen

...12tss = options.tss1314#cluster_115heat_file = open(input, 'r')16heat_file_readlines = heat_file.readlines()17tss_file = open(tss, 'r')18tss_file_readlines = tss_file.readlines()19c1_file = open("c1_" + input, 'w')2021for a in range(0, len(heat_file_readlines)):22 if str((heat_file_readlines[a]).split()[12]) == "cluster_1":23 for b in range(0, len(tss_file_readlines)):24 if str((heat_file_readlines[a]).split()[3]) == str((tss_file_readlines[b]).split()[3]) :25 c1_file.write(tss_file_readlines[b])26 else:27 pass28 else:29 pass30heat_file.close()31tss_file.close()32c1_file.close()3334#cluster_235heat_file = open(input, 'r')36heat_file_readlines = heat_file.readlines()37tss_file = open(tss, 'r')38tss_file_readlines = tss_file.readlines()39c2_file = open("c2_" + input, 'w')4041for a in range(0, len(heat_file_readlines)):42 if str((heat_file_readlines[a]).split()[12]) == "cluster_2":43 for b in range(0, len(tss_file_readlines)):44 if str((heat_file_readlines[a]).split()[3]) == str((tss_file_readlines[b]).split()[3]) :45 c2_file.write(tss_file_readlines[b])46 else:47 pass48 else:49 pass50heat_file.close()51tss_file.close()52c2_file.close() ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run refurb automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful