import GanetiCluster, paramiko, os
class JustSendFiles(object):
def __init__(self):
eucacluster = GanetiCluster.GanetiCluster('Coordinator.properties')
instances = eucacluster.describe_instances()
for instance in instances:
print str(instance.ip_address)
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(instance.ip_address, username='root', password='secretpw')
if instance.ip_address == "192.168.1.80":
print "master"
#stdin, stdout, stderr = ssh.exec_command('/bin/sh ~/gstar/bandwidth_limit.sh')
else:
stdin, stdout, stderr = ssh.exec_command('sudo apt-get -y remove --purge apache2 ganglia-*')
ssh.close()
if __name__ == "__main__":
sendthem = JustSendFiles()