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
requested log entries.
"""
llen = self._redis.llen(self._logs_key(build_id))
log_entries = self._redis.lrange(self._logs_key(build_id), start_index, -1)
return (llen, (json.loads(entry) for entry in log_entries))
try:
llen = self._redis.llen(self._logs_key(build_id))
log_entries = self._redis.lrange(self._logs_key(build_id), start_index, -1)
return (llen, (json.loads(entry) for entry in log_entries))
except redis.ConnectionError:
return (0, [])
@staticmethod
def _status_key(build_id):
@ -59,5 +62,9 @@ class BuildLogs(object):
"""
Loads the status information for the specified build id.
"""
fetched = self._redis.get(self._status_key(build_id))
try:
fetched = self._redis.get(self._status_key(build_id))
except redis.ConnectionError:
return 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)
resp = {
'id': build_obj.uuid,
'phase': build_obj.phase,
'phase': build_obj.phase if status else 'cannot_load',
'started': format_date(build_obj.started),
'display_name': build_obj.display_name,
'status': status,
'status': status or {},
'job_config': get_job_config(build_obj) if can_write else None,
'is_writer': can_write,
'trigger': trigger_view(build_obj.trigger),

View file

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

View file

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

View file

@ -143,4 +143,8 @@
</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>