def valid_request_body()

in CWMetricsToOpenSearch/es_sink/transport_utils.py [0:0]


def valid_request_body(body):
    ''' Helper function to ensure request bodies terminate with a new line
        and to replace None with the empty string.'''
    if body and not body.endswith("\n"):
        body += "\n"
    elif not body:
        body = ""
    return body