def _push_assemble_error_status(status, ret, logs):
 comment = 'An error occurred pushing your image'
 status['out'] = ''
 try:
  status['out'] += ('\n' + ret)
  for err_log in logs:
   if isinstance(err_log, dict):
    if ('errorDetail' in err_log):
     if ('code' in err_log['errorDetail']):
      msg = '\n{0}\n{1}: {2}'.format(err_log['error'], err_log['errorDetail']['code'], err_log['errorDetail']['message'])
     else:
      msg = '\n{0}\n{1}'.format(err_log['error'], err_log['errorDetail']['message'])
     comment += msg
 except Exception:
  trace = traceback.format_exc()
  status['out'] = 'An error occurred while parsing error output:\n{0}'.format(trace)
 _invalid(status, comment=comment)
 return status

def _push_assemble_error_status ( status , ret , logs ) : comment = 'An error occurred pushing your image' status [ 'out' ] = '' try : status [ 'out' ] += ( '\n' + ret ) for err_log in logs : if isinstance ( err_log , dict ) : if ( 'errorDetail' in err_log ) : if ( 'code' in err_log [ 'errorDetail' ] ) : msg = '\n{0}\n{1}: {2}' . format ( err_log [ 'error' ] , err_log [ 'errorDetail' ] [ 'code' ] , err_log [ 'errorDetail' ] [ 'message' ] ) else : msg = '\n{0}\n{1}' . format ( err_log [ 'error' ] , err_log [ 'errorDetail' ] [ 'message' ] ) comment += msg except Exception : trace = traceback . format_exc ( ) status [ 'out' ] = 'An error occurred while parsing error output:\n{0}' . format ( trace ) _invalid ( status , comment = comment ) return status
given input in this form:: u{"status":"pulling repository foo/ubuntubox"}: "image from foo/ .