Merge remote-tracking branch 'origin/master' into swaggerlikeus

Conflicts:
	endpoints/api.py
This commit is contained in:
jakedt 2014-03-25 15:50:03 -04:00
commit 5f98bf8dab
5 changed files with 23 additions and 11 deletions

View file

@ -40,9 +40,12 @@ class BuildLogs(object):
Returns a tuple of the current length of the list and an iterable of the Returns a tuple of the current length of the list and an iterable of the
requested log entries. requested log entries.
""" """
try:
llen = self._redis.llen(self._logs_key(build_id)) llen = self._redis.llen(self._logs_key(build_id))
log_entries = self._redis.lrange(self._logs_key(build_id), start_index, -1) log_entries = self._redis.lrange(self._logs_key(build_id), start_index, -1)
return (llen, (json.loads(entry) for entry in log_entries)) return (llen, (json.loads(entry) for entry in log_entries))
except redis.ConnectionError:
return (0, [])
@staticmethod @staticmethod
def _status_key(build_id): def _status_key(build_id):
@ -59,5 +62,9 @@ class BuildLogs(object):
""" """
Loads the status information for the specified build id. Loads the status information for the specified build id.
""" """
try:
fetched = self._redis.get(self._status_key(build_id)) fetched = self._redis.get(self._status_key(build_id))
except redis.ConnectionError:
return None
return json.loads(fetched) if fetched else None return json.loads(fetched) if fetched else None

View file

@ -52,10 +52,10 @@ def build_status_view(build_obj, can_write=False):
logger.debug('Can write: %s job_config: %s', can_write, build_obj.job_config) logger.debug('Can write: %s job_config: %s', can_write, build_obj.job_config)
resp = { resp = {
'id': build_obj.uuid, 'id': build_obj.uuid,
'phase': build_obj.phase, 'phase': build_obj.phase if status else 'cannot_load',
'started': format_date(build_obj.started), 'started': format_date(build_obj.started),
'display_name': build_obj.display_name, 'display_name': build_obj.display_name,
'status': status, 'status': status or {},
'job_config': get_job_config(build_obj) if can_write else None, 'job_config': get_job_config(build_obj) if can_write else None,
'is_writer': can_write, 'is_writer': can_write,
'trigger': trigger_view(build_obj.trigger), 'trigger': trigger_view(build_obj.trigger),

View file

@ -1,10 +1,7 @@
<!-- Quay --> <!-- Quay -->
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse" style="padding: 0px; padding-left: 4px; padding-right: 4px;">
<span class="sr-only">Toggle navigation</span> <span style="font-size: 24px">&equiv;</span>
<span class="fa-bar"></span>
<span class="fa-bar"></span>
<span class="fa-bar"></span>
</button> </button>
<a class="navbar-brand" href="/" target="{{ appLinkTarget() }}"> <a class="navbar-brand" href="/" target="{{ appLinkTarget() }}">
<img src="/static/img/quay-logo.png"> <img src="/static/img/quay-logo.png">

View file

@ -3544,6 +3544,9 @@ quayApp.directive('buildMessage', function () {
controller: function($scope, $element) { controller: function($scope, $element) {
$scope.getBuildMessage = function (phase) { $scope.getBuildMessage = function (phase) {
switch (phase) { switch (phase) {
case 'cannot_load':
return 'Cannot load build status - Please report this error';
case 'starting': case 'starting':
case 'initializing': case 'initializing':
return 'Starting Dockerfile build'; return 'Starting Dockerfile build';
@ -3598,6 +3601,7 @@ quayApp.directive('buildProgress', function () {
case 'initializing': case 'initializing':
case 'starting': case 'starting':
case 'waiting': case 'waiting':
case 'cannot_load':
return 0; return 0;
break; break;
} }

View file

@ -143,4 +143,8 @@
</div> </div>
</div> </div>
</div> </div>
<div style="border-top: 1px solid #eee; padding-top: 20px;">
<a href="https://mixpanel.com/f/partner"><img src="//cdn.mxpnl.com/site_media/images/partner/badge_light.png" alt="Mobile Analytics" /></a>
</div>
</div> </div>