Skip to content

Commit 343e731

Browse files
committed
upgrading inspector to python 3.7
1 parent 8177515 commit 343e731

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

inspector/python/inspector.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
import json
3-
import httplib
3+
import http.client
44
import base64,zlib
5-
import urlparse
5+
import urllib.parse
66
import boto3
77
import datetime
88
import logging
@@ -19,7 +19,7 @@
1919
##################################################################
2020
# Main Code #
2121
##################################################################
22-
up = urlparse.urlparse(sumoEndpoint)
22+
up = urllib.parse.urlparse(sumoEndpoint)
2323
options = { 'hostname': up.hostname,
2424
'path': up.path,
2525
'method': 'POST'
@@ -33,7 +33,7 @@
3333

3434
# main function to send data to a Sumo HTTP source
3535
def sendSumo(msg, toCompress = False):
36-
conn = httplib.HTTPSConnection(options['hostname'])
36+
conn = http.client.HTTPSConnection(options['hostname'])
3737
if (toCompress):
3838
headers = {"Content-Encoding": "gzip"}
3939
finalData = compress(msg)
@@ -50,7 +50,7 @@ def sendSumo(msg, toCompress = False):
5050
# Simple function to compress data
5151
def compress(data, compresslevel=9):
5252
compress = zlib.compressobj(compresslevel, zlib.DEFLATED, 16 + zlib.MAX_WBITS, zlib.DEF_MEM_LEVEL, 0)
53-
compressedData = compress.compress(data)
53+
compressedData = compress.compress(data.encode())
5454
compressedData += compress.flush()
5555
return compressedData
5656

0 commit comments

Comments
 (0)