Hello,
SystemCommand.nmcli() uses the env parameter of subprocess.run to set the LANG environment variable. Unfortunately this clobbers the rest of the environment and can cause issues when configuring nmcli through environment variables.
E.g. On BalenaOS, the host DBUS socket is accessed by specifying an alternative DBUS_SYSTEM_BUS_ADDRESS.
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/host/run/dbus/system_bus_socket"
nmcli dev show
However as this environment variable is overwritten by usage of a minimal env paramater, running any nmcli command produces the following exception, as the command can't reach the default DBUS endpoint.
import nmcli
nmcli.disable_use_sudo()
nmcli.device.show_all()
UnspecifiedException: Unknown or unspecified error [code:1, detail:Error: Could not create NMClient object: Could not connect: No such file or directory.
Hello,
SystemCommand.nmcli()uses theenvparameter ofsubprocess.runto set theLANGenvironment variable. Unfortunately this clobbers the rest of the environment and can cause issues when configuringnmclithrough environment variables.E.g. On BalenaOS, the host DBUS socket is accessed by specifying an alternative DBUS_SYSTEM_BUS_ADDRESS.
However as this environment variable is overwritten by usage of a minimal
envparamater, running anynmclicommand produces the following exception, as the command can't reach the default DBUS endpoint.