mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
replace os.getlogin() with getpass.getuser() (#9928)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import functools
|
import functools
|
||||||
|
import getpass
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@@ -335,7 +336,7 @@ def check_permissions(port):
|
|||||||
raise EsphomeError(
|
raise EsphomeError(
|
||||||
"You do not have read or write permission on the selected serial port. "
|
"You do not have read or write permission on the selected serial port. "
|
||||||
"To resolve this issue, you can add your user to the dialout group "
|
"To resolve this issue, you can add your user to the dialout group "
|
||||||
f"by running the following command: sudo usermod -a -G dialout {os.getlogin()}. "
|
f"by running the following command: sudo usermod -a -G dialout {getpass.getuser()}. "
|
||||||
"You will need to log out & back in or reboot to activate the new group access."
|
"You will need to log out & back in or reboot to activate the new group access."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user