From 2221d4835b401ca8cb1e39b732f0a82e5ff067ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Fri, 28 Nov 2014 01:54:34 +0100 Subject: Send debugging info about this program to Zuul This will make sure that correct data appear in the output of `zuul show running-jobs`. Change-Id: If8a57e89cb23645ad7cc17f408c3b57253ccc945 --- turbo_hipster/lib/models.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py index c96a075..08e0755 100644 --- a/turbo_hipster/lib/models.py +++ b/turbo_hipster/lib/models.py @@ -17,6 +17,8 @@ import copy import json import logging import os +import pkg_resources +import socket from turbo_hipster.lib import common from turbo_hipster.lib import utils @@ -83,12 +85,25 @@ class Task(object): def _get_work_data(self): if self.work_data is None: hostname = os.uname()[1] + fqdn = socket.getfqdn() self.work_data = dict( name=self.job_name, number=self.job.unique, manager='turbo-hipster-manager-%s' % hostname, url='http://localhost', + worker_hostname=hostname, + worker_fqdn=fqdn, + worker_program='turbo-hipster', ) + try: + self.work_data['worker_version'] = ( + pkg_resources.get_distribution('turbo_hipster').version + ) + except pkg_resources.DistributionNotFound: + # Package isn't installed; I do not think that manually + # attempting to extract version in some ad-hoc manner would be + # worth it -> just ignore this. + pass return self.work_data def _send_work_data(self): -- cgit v1.2.1