diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index ca60229..623d2e4 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -42,4 +42,4 @@ given below. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.5.1a0.dev2" +__version__ = "0.5.1a0.dev3" diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index 89dd382..4dbcd20 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -37,7 +37,7 @@ from naxalnet.log import logger from naxalnet.iwd import Adapter, Device, IWD from naxalnet.config import args from naxalnet.daemon import Daemon -from naxalnet.network import NetworkD +from naxalnet.network import NetworkD, NetworkLoop def get_sorted_glob(directory: str, glob: str) -> list: @@ -56,17 +56,14 @@ def get_sorted_glob(directory: str, glob: str) -> list: def any_interface_is_routable(): """returns true if any of the interfaces is routable""" - networkd = NetworkD(runtime_dir=args.networkd_runtime_dir) + networkd = NetworkLoop(runtime_dir=args.networkd_runtime_dir) # First, add the temporary configs to networkd. for i in get_sorted_glob(args.networkd_config_dir, TMP_NET_GLOB): logger.debug("Adding temporary config %s", i) networkd.add_config(i) - # Then, wait for some time to setup the network. - # This can probably be replaced by a d-bus wait-for-signal - # function that timeouts after 10 seconds. - time.sleep(10) - routable = networkd.is_routable() + + routable = networkd.wait_until_routable() networkd.remove_all_configs() return routable