build: fix --enable-sudo behavior when set during configuration

This commit is contained in:
Gabriel Ferreira
2022-03-13 22:34:13 -03:00
parent c1bef60926
commit dcd0ed947c

2
ns3
View File

@@ -1282,7 +1282,7 @@ def main():
# Setup program as sudo
if enable_sudo or (args.run and args.enable_sudo):
sudo_step(args, target_to_run, set(ns3_programs.values()[0]) if enable_sudo else set())
sudo_step(args, target_to_run, set(map(lambda x: x[0], ns3_programs.values())) if enable_sudo else set())
# Finally, we try to run it
if args.shell or run_only or build_and_run: