summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2022-10-19 11:52:30 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2022-10-21 15:24:11 +0000
commit4c7954606ca589090b555ca4d38340e3d125931c (patch)
treeaa00f53df5f8b163349e2bc3ae3981f50c3f3772
parent18334ec7871dbdde3c418231764d139e18a7b92e (diff)
ospfclient: add 'wait,<seconds>' action to ospfclient.py - for testing
Signed-off-by: Lou Berger <lberger@labn.net> (cherry picked from commit 20d26a9e08aa2e104bef1e4dd0cb347c9a2ab912)
-rwxr-xr-xospfclient/ospfclient.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfclient/ospfclient.py b/ospfclient/ospfclient.py
index c7cfc88b9c..19561145a0 100755
--- a/ospfclient/ospfclient.py
+++ b/ospfclient/ospfclient.py
@@ -1099,6 +1099,12 @@ async def async_main(args):
for action in args.actions:
_s = action.split(",")
what = _s.pop(False)
+ if what.casefold() == "wait":
+ stime = int(_s.pop(False))
+ logging.info("waiting %s seconds", stime)
+ await asyncio.sleep(stime)
+ logging.info("wait complete: %s seconds", stime)
+ continue
ltype = int(_s.pop(False))
if ltype == 11:
addr = ip(0)