Skip to content

Commit

Permalink
use 'os' to retrieve the logged user name
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelweingartner authored and felixonmars committed Nov 12, 2023
1 parent 373e483 commit aaabbea
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pifpaf/drivers/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ def _setUp(self):
os.mkdir(datadir)
os.mkdir(tempdir)

c, out = self._exec(["whoami"], stdout=True, ignore_failure=True,
path=["/usr/libexec"])

if isinstance(out, bytes):
out = out.decode('UTF-8')

if not isinstance(out, str):
out = str(out)

mysql_user_to_use = out.strip()
mysql_user_to_use = os.getlogin()

c, _ = self._exec(["mysqld",
"--no-defaults",
Expand Down

0 comments on commit aaabbea

Please sign in to comment.