gobgp icon indicating copy to clipboard operation
gobgp copied to clipboard

ReplaceStatement

Open thoro opened this issue 6 years ago • 1 comments

Hi,

I once made the #1426 issue that replaceStatement does not work as expected, following it was removed.

With 2.0 using addStatement will throw an error if a condition is already set (not sure if that also happens in 1.33)

Is there a possibility to implement replaceStatement (same as addStatement, just remove the if and always set the statement map)? Where is the issue with such an API?

thoro avatar Feb 12 '19 16:02 thoro

def replaceStatement(statement_map, new_statement):
    statement_map.clear()  # Clear all existing statements
    statement_map['statement'] = new_statement

# Example usage:
statement_map = {}
new_statement = {
    # Your new statement attributes here
}
replaceStatement(statement_map, new_statement)

ljluestc avatar Jan 20 '24 20:01 ljluestc