except Exception as err:
return '0.0.0.0'
-def gbs_update_dashboard(raw_data, via='trigger'):
- raw_data["_timestamp"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
- raw_data["_worker"] = {"node_name": os.getenv('NODE_NAME'),
- "ip": find_my_ip()}
- if via == 'trigger':
- trigger_next("DASHBOARD_UPDATE_%s" % raw_data.get("tag").replace('/', '_'), raw_data)
- else:
- try:
- encoded_data = base64.b64encode(json.dumps(raw_data))
- remote_jenkins_build_job(os.getenv('JENKINS_URL_INTERNAL'), \
- os.getenv('JENKINS_USER'), \
- os.getenv('JENKINS_PW'), \
- jobname=os.getenv('DASHBOARD_UPDATE_JOB_NAME'), \
- data='TRIGGER_INFO="%s"' % (quote_plus(encoded_data)))
- except Exception as err:
- trigger_next("DASHBOARD_UPDATE_%s" % raw_data.get("tag").replace('/', '_'), raw_data)
import json
from common.git import Git, clone_gitproject
from common.utils import sync
-from common.buildtrigger import remote_jenkins_build_job
+from common.buildtrigger import remote_jenkins_build_job, trigger_next
from urllib import quote_plus
+from datetime import datetime
class RuntimeException(Exception):
"""Local error handler"""
return rpm_file_info
+def gbs_update_dashboard(raw_data, via='trigger'):
+ raw_data["_timestamp"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+ raw_data["_worker"] = {"node_name": os.getenv('NODE_NAME'),
+ "ip": find_my_ip()}
+ if via == 'trigger':
+ trigger_next("DASHBOARD_UPDATE_%s" % raw_data.get("tag").replace('/', '_'), raw_data)
+ else:
+ try:
+ encoded_data = base64.b64encode(json.dumps(raw_data))
+ remote_jenkins_build_job(os.getenv('JENKINS_URL_INTERNAL'), \
+ os.getenv('JENKINS_USER'), \
+ os.getenv('JENKINS_PW'), \
+ jobname=os.getenv('DASHBOARD_UPDATE_JOB_NAME'), \
+ data='TRIGGER_INFO="%s"' % (quote_plus(encoded_data)))
+ except Exception as err:
+ trigger_next("DASHBOARD_UPDATE_%s" % raw_data.get("tag").replace('/', '_'), raw_data)
+