summaryrefslogtreecommitdiffstats
path: root/scripts/send-error-report
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/send-error-report')
-rwxr-xr-xscripts/send-error-report14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/send-error-report b/scripts/send-error-report
index ed78bd6ebb..a9f6e42d17 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -7,7 +7,7 @@
7# Author: Andreea Proca <andreea.b.proca@intel.com> 7# Author: Andreea Proca <andreea.b.proca@intel.com>
8# Author: Michael Wood <michael.g.wood@intel.com> 8# Author: Michael Wood <michael.g.wood@intel.com>
9 9
10import urllib2 10import urllib.request, urllib.error
11import sys 11import sys
12import json 12import json
13import os 13import os
@@ -25,10 +25,10 @@ log = logging.getLogger("send-error-report")
25logging.basicConfig(format='%(levelname)s: %(message)s') 25logging.basicConfig(format='%(levelname)s: %(message)s')
26 26
27def getPayloadLimit(url): 27def getPayloadLimit(url):
28 req = urllib2.Request(url, None) 28 req = urllib.request.Request(url, None)
29 try: 29 try:
30 response = urllib2.urlopen(req) 30 response = urllib.request.urlopen(req)
31 except urllib2.URLError as e: 31 except urllib.error.URLError as e:
32 # Use this opportunity to bail out if we can't even contact the server 32 # Use this opportunity to bail out if we can't even contact the server
33 log.error("Could not contact server: " + url) 33 log.error("Could not contact server: " + url)
34 log.error(e.reason) 34 log.error(e.reason)
@@ -136,10 +136,10 @@ def send_data(data, args):
136 else: 136 else:
137 url = "http://"+args.server+"/ClientPost/" 137 url = "http://"+args.server+"/ClientPost/"
138 138
139 req = urllib2.Request(url, data=data, headers=headers) 139 req = urllib.request.Request(url, data=data, headers=headers)
140 try: 140 try:
141 response = urllib2.urlopen(req) 141 response = urllib.request.urlopen(req)
142 except urllib2.HTTPError, e: 142 except urllib.error.HTTPError as e:
143 logging.error(e.reason) 143 logging.error(e.reason)
144 sys.exit(1) 144 sys.exit(1)
145 145