From fd2e2369272fe42e23464ef74716f4c82a3e6ebc Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 14 Feb 2024 19:29:07 +0800 Subject: [PATCH] Add GNS3 console command "env" to show what environment variables are used. Ref https://github.com/GNS3/gns3-server/issues/2306 --- gns3/console_cmd.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gns3/console_cmd.py b/gns3/console_cmd.py index 702308ee..183f57e1 100644 --- a/gns3/console_cmd.py +++ b/gns3/console_cmd.py @@ -19,6 +19,7 @@ Handles commands typed in the GNS3 console. """ +import os import sys import cmd import struct @@ -34,6 +35,14 @@ log = logging.getLogger(__name__) class ConsoleCmd(cmd.Cmd): + def do_env(self, args): + """ + Show the environment variables used by GNS3. + """ + + for key, val in os.environ.items(): + print("{}={}".format(key, val)) + def do_version(self, args): """ Show the version of GNS3 and its dependencies.