temporary hack to fix #19

Probably s/temporary/permanent/ if someone doesn't take over this
"project" soon.
This commit is contained in:
Pranav Jerry 2021-09-28 12:37:11 +05:30
parent 87612fac2c
commit 5bde1faeba
No known key found for this signature in database
GPG Key ID: F1DCDC4FED0A0C5B
3 changed files with 15 additions and 1 deletions

View File

@ -35,4 +35,4 @@ See README.md for documentation.
#
# In case you forgot to change the version, skip the number
# and put the next number in the next commit.
__version__ = "0.4.0a5.dev4"
__version__ = "0.4.0a5.dev5"

View File

@ -71,7 +71,18 @@ class NetworkD:
def delete_interface(self, name: str) -> None:
"""delete the given interface"""
# If anyone knows a better way of doing this, create
# an issue and get things done
subprocess.run(["networkctl", "delete", name], check=True)
# This is probably not required. This is mainly to shut up
# pylint's messages
self.reload()
def disable_config(self, name: str) -> None:
"""Disable the config of the given name"""
path = self.runtime_path / name
path.symlink_to("/dev/null")
self.reload()
def remove_config(self, name: str) -> None:
"""

View File

@ -93,6 +93,9 @@ def setup_mesh(gateway_mode: str = "off"):
gateway_mode=gateway_mode,
)
# Fix for issue #19
networkd.disable_config("80-wifi-adhoc.network")
for i in get_sorted_glob(args.networkd_config_dir, MESH_GLOB):
logger.debug("Adding network config %s", i)
networkd.add_config(i)