formatting

master
Ken Subratie 2023-11-29 17:50:27 -05:00
parent a8fb60cac6
commit b9ddecb320
3 changed files with 11 additions and 4 deletions

View File

@ -252,11 +252,15 @@ class ConfigurationError(ValueError):
self.msgfmt = message
def run_proc(cmd: list[str]) -> subprocess.CompletedProcess:
def run_proc(cmd: list[str], check=True, timeout=30.0) -> subprocess.CompletedProcess:
"""Run a shell command"""
# print(cmd)
return subprocess.run(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, timeout=30.0
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=check,
timeout=timeout,
)

View File

@ -40,7 +40,6 @@ class TimedTransactions:
def _get_expired(self, entry):
if not entry.is_completed():
# entry.time_expired = time.time()
entry.on_expired(entry.item, time.time())
def _run(self):

View File

@ -655,10 +655,14 @@ class Topology(ControllerModule):
olid = params["OverlayId"]
ovl = self._net_ovls[olid]
peer_id = params["PeerId"]
tnlid = params["TunnelId"]
response_data = cbt.response.data
if not cbt.response.status:
self.logger.warning(
"Failed to create topology edge to %s. %s", peer_id, response_data
"Failed to create topology edge %s to %s. %s",
tnlid,
peer_id,
response_data,
)
ovl.known_peers[peer_id].exclude()
del ovl.adjacency_list[peer_id]