(value, chars=None)
return value.rstrip(chars) or value
Removes trailing characters from a string if that does not make it empty

    :param value: A string value that will be stripped.
    :param chars: Characters to remove.
    :return: Stripped value.
Removes trailing characters from a string if that does not make it empty
Removes trailing characters from a string if that does not make it empty
def safe_rstrip(value, chars=None):
    """Removes trailing characters from a string if that does not make it empty

    :param value: A string value that will be stripped.
    :param chars: Characters to remove.
    :return: Stripped value.

    """
    if not isinstance(value, six.string_types):
        LOG.warning("Failed to remove trailing character. "
                    "Returning original object. "
                    "Supplied object is not a string: %s,", value)
        return value

    return value.rstrip(chars) or value
def safe_rstrip ( value , chars = None ) : if not isinstance ( value , six . string_types ) : LOG . warning ( "Failed to remove trailing character. " "Returning original object. " "Supplied object is not a string: %s," , value ) return value return value . rstrip ( chars ) or value