Skip to content

Commit

Permalink
Fix pep8 test error
Browse files Browse the repository at this point in the history
  • Loading branch information
travelist committed May 31, 2015
1 parent 0418e47 commit 0422901
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 44 deletions.
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions surge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions surge/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions surge/surge_deployer/surge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
2 changes: 0 additions & 2 deletions tests/test_vagrant_deployer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down
57 changes: 27 additions & 30 deletions tools/send_test_data_to_kafka.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand All @@ -19,37 +17,36 @@
from kafka import KafkaClient
from kafka import KafkaConsumer


class Producer(object):

def __init__(self, broker_ip_port):
self.kafka = KafkaClient(broker_ip_port)
self.producer = SimpleProducer(self.kafka)

def send_message(self):
response = self.producer.send_messages("HEYA","Hello World","Kafka Deployment Worked!")
return [("Error ",response[0].error ), response ]
def __init__(self, broker_ip_port):
self.kafka = KafkaClient(broker_ip_port)
self.producer = SimpleProducer(self.kafka)

def send_message(self):
response = self.producer.send_messages("HEY", "Hello World", "Kafka Deployment Worked!")
return [("Error ", response[0].error), response]

def close(self):
self.kafka.close()

def close(self):
self.kafka.close()

class Consumer(object):

def __init__(self,broker_ip_port):
self.consumer = KafkaConsumer("HEYA", group_id="my_group",
metadata_broker_list=[broker_ip_port])

def consume_message(self):
print self.consumer
for message in self.consumer :
print message
print self.consumer



if __name__== "__main__":
producer = Producer("172.17.1.137:9092")
print producer.send_message()
producer.close()
con = Consumer("172.17.1.137:9092")
con.consume_message()

def __init__(self,broker_ip_port):
self.consumer = KafkaConsumer(
"HEYA", group_id="my_group", metadata_broker_list=[broker_ip_port])

def consume_message(self):
print self.consumer
for message in self.consumer :
print message
print self.consumer

if __name__ == "__main__":
producer = Producer("172.17.1.137:9092")
print producer.send_message()
producer.close()
con = Consumer("172.17.1.137:9092")
con.consume_message()

0 comments on commit 0422901

Please sign in to comment.