Skip to content

Commit 9329e28

Browse files
committed
feat(config): don't fail if no community present
Do not fail if no community has been specified. We relax this for the time being in order to test. Signed-off-by: Fredi Raspall <[email protected]>
1 parent 39d5db0 commit 9329e28

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

config/src/external/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,16 @@ impl ExternalConfig {
8080
debug!("Gateway {gwname} is at position {pos} of {}", group.name());
8181

8282
// Get the community corresponding to the position/ordering of this gateway in the group.
83-
// If no community exist for that position, fail. This may happen with large groups.
83+
// If no community exist for that position, we should fail, although we don't now since
84+
// the community table may not be populated.
8485
// To guarantee that we can always tag with a community in the set of |C| communities,
8586
// the size of a group |G| must be no larger than |C|.
86-
let community = comtable.get_community(pos)?;
87-
Ok(Some(community.clone()))
87+
if let Ok(community) = comtable.get_community(pos) {
88+
Ok(Some(community.clone()))
89+
} else {
90+
warn!("No community found for preference {pos}");
91+
Ok(None)
92+
}
8893
}
8994

9095
fn validate_peering_gw_groups(&mut self) -> ConfigResult {

0 commit comments

Comments
 (0)