gobgp
gobgp copied to clipboard
ReplaceStatement
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?
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)