You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a check_config() is called on a Router object, the type of neighbor_addresses and server_addresses changes from list to frozenset:
def check_config(self):
.....
for field in self.ipaddress_fields:
if field in self.bgp:
self.bgp[field] = frozenset([
self._check_ip_str(ip_str) for ip_str in self.bgp[field]])
This trips up if check_config() is called again on the same Router object:
[InvalidConfigError("DP swdev: server_addresses value frozenset({IPv4Address('127.0.0.1')}) must be <class 'list'> not <class 'frozenset'>")]
A terrible fix could be updating the type when we encapsulate it in frozenset() but it seems like there could be a better fix:
diff --git a/faucet/router.py b/faucet/router.py
index 4b6b44ce..33acb6cd 100644
--- a/faucet/router.py
+++ b/faucet/router.py
@@ -84,6 +84,7 @@ class Router(Conf):
if field in self.bgp:
self.bgp[field] = frozenset([
self._check_ip_str(ip_str) for ip_str in self.bgp[field]])
+ self.bgp_defaults_types[field] = frozenset
for accessor_val, required_field in (
(self.bgp_ipvs(), 'server_addresses'),
(self.bgp_as(), 'as'),
The text was updated successfully, but these errors were encountered:
When a check_config() is called on a Router object, the type of
neighbor_addresses
andserver_addresses
changes fromlist
tofrozenset
:This trips up if check_config() is called again on the same Router object:
[InvalidConfigError("DP swdev: server_addresses value frozenset({IPv4Address('127.0.0.1')}) must be <class 'list'> not <class 'frozenset'>")]
A terrible fix could be updating the type when we encapsulate it in frozenset() but it seems like there could be a better fix:
The text was updated successfully, but these errors were encountered: