|
@@ -38,7 +38,7 @@ from desktop.lib.exceptions_renderable import PopupException
|
|
|
from django.utils.translation import ugettext as _
|
|
from django.utils.translation import ugettext as _
|
|
|
from jobbrowser.conf import DISABLE_KILLING_JOBS
|
|
from jobbrowser.conf import DISABLE_KILLING_JOBS
|
|
|
|
|
|
|
|
-LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
+LOG = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
|
def can_view_job(username, job):
|
|
def can_view_job(username, job):
|
|
@@ -449,11 +449,11 @@ class TaskAttempt(object):
|
|
|
tracker = Tracker.from_name(self.task.jt, self.taskTrackerId)
|
|
tracker = Tracker.from_name(self.task.jt, self.taskTrackerId)
|
|
|
return tracker
|
|
return tracker
|
|
|
except ttypes.TaskTrackerNotFoundException, e:
|
|
except ttypes.TaskTrackerNotFoundException, e:
|
|
|
- LOGGER.warn("Tracker %s not found: %s" % (self.taskTrackerId, e))
|
|
|
|
|
- if LOGGER.isEnabledFor(logging.DEBUG):
|
|
|
|
|
|
|
+ LOG.warn("Tracker %s not found: %s" % (self.taskTrackerId, e))
|
|
|
|
|
+ if LOG.isEnabledFor(logging.DEBUG):
|
|
|
all_trackers = self.task.jt.all_task_trackers()
|
|
all_trackers = self.task.jt.all_task_trackers()
|
|
|
for t in all_trackers.trackers:
|
|
for t in all_trackers.trackers:
|
|
|
- LOGGER.debug("Available tracker: %s" % (t.trackerName,))
|
|
|
|
|
|
|
+ LOG.debug("Available tracker: %s" % (t.trackerName,))
|
|
|
raise ttypes.TaskTrackerNotFoundException(
|
|
raise ttypes.TaskTrackerNotFoundException(
|
|
|
_("Cannot look up TaskTracker %(id)s.") % {'id': self.taskTrackerId})
|
|
_("Cannot look up TaskTracker %(id)s.") % {'id': self.taskTrackerId})
|
|
|
|
|
|
|
@@ -475,7 +475,7 @@ class TaskAttempt(object):
|
|
|
None,
|
|
None,
|
|
|
'attemptid=%s' % (self.attemptId,),
|
|
'attemptid=%s' % (self.attemptId,),
|
|
|
None))
|
|
None))
|
|
|
- LOGGER.info('Retrieving %s' % (url,))
|
|
|
|
|
|
|
+ LOG.info('Retrieving %s' % (url,))
|
|
|
try:
|
|
try:
|
|
|
data = urllib2.urlopen(url)
|
|
data = urllib2.urlopen(url)
|
|
|
except urllib2.URLError:
|
|
except urllib2.URLError:
|
|
@@ -485,7 +485,7 @@ class TaskAttempt(object):
|
|
|
log_sections = et.findall('body/pre')
|
|
log_sections = et.findall('body/pre')
|
|
|
logs = [section.text or '' for section in log_sections]
|
|
logs = [section.text or '' for section in log_sections]
|
|
|
if len(logs) < 3:
|
|
if len(logs) < 3:
|
|
|
- LOGGER.warn('Error parsing task attempt log for %s at "%s". Found %d (not 3) log sections' %
|
|
|
|
|
|
|
+ LOG.warn('Error parsing task attempt log for %s at "%s". Found %d (not 3) log sections' %
|
|
|
(self.attemptId, url, len(log_sections)))
|
|
(self.attemptId, url, len(log_sections)))
|
|
|
err = _("Hue encountered an error while retrieving logs from '%s'.") % (url,)
|
|
err = _("Hue encountered an error while retrieving logs from '%s'.") % (url,)
|
|
|
logs += [err] * (3 - len(logs))
|
|
logs += [err] * (3 - len(logs))
|
|
@@ -582,7 +582,7 @@ class LinkJobLogs(object):
|
|
|
try:
|
|
try:
|
|
|
return '<a href="%s" target="_blank">%s</a>' % (location_to_url(match.group(0), strict=False), match.group(0))
|
|
return '<a href="%s" target="_blank">%s</a>' % (location_to_url(match.group(0), strict=False), match.group(0))
|
|
|
except:
|
|
except:
|
|
|
- LOGGER.exception('failed to replace hdfs links: %s' % (match.groups(),))
|
|
|
|
|
|
|
+ LOG.exception('failed to replace hdfs links: %s' % (match.groups(),))
|
|
|
return match.group(0)
|
|
return match.group(0)
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -590,7 +590,7 @@ class LinkJobLogs(object):
|
|
|
try:
|
|
try:
|
|
|
return '<a href="%s" target="_blank">%s</a>' % (reverse('jobbrowser.views.single_job', kwargs={'job': match.group(0)}), match.group(0))
|
|
return '<a href="%s" target="_blank">%s</a>' % (reverse('jobbrowser.views.single_job', kwargs={'job': match.group(0)}), match.group(0))
|
|
|
except:
|
|
except:
|
|
|
- LOGGER.exception('failed to replace mr links: %s' % (match.groups(),))
|
|
|
|
|
|
|
+ LOG.exception('failed to replace mr links: %s' % (match.groups(),))
|
|
|
return match.group(0)
|
|
return match.group(0)
|
|
|
|
|
|
|
|
|
|
|