Skip to content

Commit

Permalink
test: development commit, work in progress, to squash
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmet2mir committed Sep 27, 2023
1 parent 43e16fc commit ccd0585
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions src/exabgp/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,31 +445,13 @@ def _reload(self):

def validate(self):
for neighbor in self.neighbors.values():
# only processes are validated here
if "processes" not in neighbor.api:
continue

if not neighbor.api["processes"]:
return self.error.set(
"\n\nneighbor '%s' declared processes key but it's empty.n\n"
% (neighbor['peer-address']),
)

if len(neighbor.api["processes"]) > 1 and neighbor.PROCESS_ALL in neighbor.api["processes"]:
return self.error.set(
"\n\nneighbor '%s' declared '%s' in processes but it's mutual exclusive with other '%s'.\n\n"
% (neighbor['peer-address'], neighbor.PROCESS_ALL, neighbor.api["processes"]),
)

if neighbor.api["processes"] == [neighbor.PROCESS_ALL]:
continue

for api in neighbor.api["processes"]:
if not self.processes[api].get('run', ''):
return self.error.set(
"\n\nan api called '%s' is used by neighbor '%s' but not defined\n\n"
% (api, neighbor['peer-address']),
)
for notification in neighbor.api:
for api in neighbor.api[notification]:
if not self.processes[api].get('run', ''):
return self.error.set(
"\n\nan api called '%s' is used by neighbor '%s' but not defined\n\n"
% (api, neighbor['peer-address']),
)
return None

def _link(self):
Expand Down

0 comments on commit ccd0585

Please sign in to comment.