Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/graphite.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


import argparse
import ConfigParser
import configparser
import csv
import gzip
import os
Expand Down Expand Up @@ -93,7 +93,7 @@ def get_graphite_config(config_file, args=None):
}

if config_file and os.path.exists(config_file):
config = ConfigParser.SafeConfigParser(graphite_config)
config = configparser.ConfigParser(delimiters=('='), strict=False).SafeConfigParser(graphite_config)
config.read(config_file)

# Cast ConfigParser.items()'s list of tuples into dict:
Expand Down Expand Up @@ -264,7 +264,7 @@ def send_metrics(metrics, host, port):
sock = socket.socket()
sock.settimeout(6)
sock.connect((host, int(port)))
sock.sendall('\n'.join(metrics) + '\n')
sock.sendall(('\n'.join(metrics) + '\n').encode())
sock.shutdown(1)


Expand Down
12 changes: 6 additions & 6 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def test_saved_search(self):
fabric.contrib.files.append(log_file, log_line, use_sudo=True)
nc_return = fabric.api.run('nc -l 2003')
test_str = "test_metric %s" % rand_int
print "nc_return----"
print nc_return
print "---"
print dir(nc_return)
print "nc_return----"
print test_str in nc_return.stdout
print("nc_return----")
print(nc_return)
print("---")
print(dir(nc_return))
print("nc_return----")
print(test_str in nc_return.stdout)
self.assertTrue(test_str in nc_return.stdout)

def test_unconfigured_app(self):
Expand Down