Skip to content

Commit

Permalink
more output
Browse files Browse the repository at this point in the history
  • Loading branch information
don41382 committed Oct 31, 2016
1 parent 5823a20 commit 92c1821
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file added .kafkatunnel.py.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -52,7 +52,7 @@ afterwards you have to provide your root password in order to create the interfa
_| ( / Amazon Linux AMI
___|\___|___|

[ec2-user@ip-10-13-89-119 ~]$
[ec2-user@ip-10-11-85-128 ~]$

On a second screen just do whatever you want, e.g. list all topics.

Expand Down
8 changes: 4 additions & 4 deletions kafkatunnel.py
Expand Up @@ -17,7 +17,7 @@ def cli():
@click.option('-p','--profile',default='default')
def aws(jump_host,zookeeper_port,kafka_port,region,profile):
instances=[]
click.echo('retrieving ip\'s from AWS zookeeper/kafka ec2 instances by tag_name ...')
click.echo(' * retrieving ip\'s from AWS ({},{}) zookeeper/kafka ec2 instances by tag_name ...'.format(profile,region))
aws = AWSInstances(profile,region)
instances += aws.getIps('zookeeper',zookeeper_port)
instances += aws.getIps('kafka',kafka_port)
Expand All @@ -32,7 +32,7 @@ def aws(jump_host,zookeeper_port,kafka_port,region,profile):
@click.option('-kp','--kafka_port',default='9091')
def manual(jump_host,zookeeper_ips, kafka_ips, zookeeper_port, kafka_port):
instances=[]
click.echo('using manual ip\'s ...')
click.echo(' * using manual ip\'s ...')
man = ManualInstances()
instances += man.getIps('zookeeper',zookeeper_ips, zookeeper_port)
instances += man.getIps('kafka',kafka_ips, kafka_port)
Expand All @@ -58,7 +58,7 @@ def remove_local_interfaces(instances):
click.echo(' * removing interface, user/root password might be needed')
for instance in instances:
if sys.platform == 'darwin':
cmd = ['sudo', 'ifconfig', 'lo0', '-alias', instance.ip]
cmd = ['sudo', 'ifconfig', 'lo0', '-alias', instance.ip]
else:
cmd = ['sudo', 'ip', 'del', 'a', 'dev', 'lo', instance.ip]
subprocess.call(cmd)
Expand All @@ -70,7 +70,7 @@ def print_instances(instances):
click.echo('')

def connect_ssh_tunnel(jump_host,instances):
click.echo('connecting to jump host')
click.echo(' * connecting to jump host ' + jump_host)
opts = []
for i in instances:
opts += ['-L','{ip}:{port}:{ip}:{port}'.format(ip=i.ip,port=i.port)]
Expand Down
Binary file modified kafkatunnel.pyc
Binary file not shown.

0 comments on commit 92c1821

Please sign in to comment.