assert isinstance(traffic_policy_dictionary,
dict), "Traffic policy must be dictionary"
prob = 0
existing_backends = set(self.get_all_backends())
for backend, weight in traffic_policy_dictionary.items():
prob += weight
assert backend in existing_backends, \
"Attempted to assign traffic to a backend "{}" that " \
After Change
prob, 1, atol=0.02
), "weights must sum to 1, currently they sum to {}".format(prob)
self.traffic_policies[endpoint_name] = traffic_policy_dictionary
// NOTE(edoakes): we must write a checkpoint before pushing the
// update to avoid inconsistent state if we crash after pushing the