(op)
Return all container stopped events with a non-zero exit status.
Return all container stopped events with a non-zero exit status.
Return all container stopped events with a non - zero exit status .
def get_container_stopped_error_events(op):
  """Return all container stopped events with a non-zero exit status."""
  events = get_events(op)
  if not events:
    return None

  if _API_VERSION == google_v2_versions.V2ALPHA1:

    return [
        e for e in events if is_container_stopped_event(e) and
        e.get('details', {}).get('exitStatus', 0) != 0
    ]

  elif _API_VERSION == google_v2_versions.V2BETA:

    return [
        e for e in events if is_container_stopped_event(e) and
        e['containerStopped'].get('exitStatus', 0) != 0
    ]

  else:
    assert False, 'Unexpected version: {}'.format(_API_VERSION)
def get_container_stopped_error_events ( op ) : events = get_events ( op ) if not events : return None if _API_VERSION == google_v2_versions . V2ALPHA1 : return [ e for e in events if is_container_stopped_event ( e ) and e . get ( 'details' , { } ) . get ( 'exitStatus' , 0 ) != 0 ] elif _API_VERSION == google_v2_versions . V2BETA : return [ e for e in events if is_container_stopped_event ( e ) and e [ 'containerStopped' ] . get ( 'exitStatus' , 0 ) != 0 ] else : assert False , 'Unexpected version: {}' . format ( _API_VERSION )