Skip to content

Commit

Permalink
Merge pull request #29 from LabNConsulting/chopps/newvars
Browse files Browse the repository at this point in the history
code: add some environment variables to new window environs
  • Loading branch information
choppsv1 authored Jan 15, 2024
2 parents d7e675b + 0a398ab commit 644ad0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions munet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,14 @@ def run_in_window(
else:
# This is the command to execute to be inside the namespace.
# We are getting into trouble with quoting.
# Why aren't we passing in MUNET_RUNDIR?
cmd = f"/usr/bin/env MUNET_NODENAME={self.name} {cmd}"
envvars = f"MUNET_NODENAME={self.name} NODENAME={self.name}"
if hasattr(self, "rundir"):
envvars += f" RUNDIR={self.rundir}"
if self.unet.config_dirname:
envvars += f" CONFIGDIR={self.unet.config_dirname}"
elif "CONFIGDIR" in os.environ:
envvars += f" CONFIGDIR={os.environ['CONFIGDIR']}"
cmd = f"/usr/bin/env {envvars} {cmd}"
# We need sudo b/c we are executing as the user inside the window system.
sudo_path = get_exec_path_host(["sudo"])
nscmd = (
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "munet"
version = "0.13.11"
version = "0.13.12"
description = "A package to facilitate network simulations"
authors = ["Christian Hopps <chopps@labn.net>"]
license = "GPL-2.0-or-later"
Expand Down

0 comments on commit 644ad0c

Please sign in to comment.