Fix DUO106 warnings

(Introduces a DUO116 warning)
This commit is contained in:
Shreya 2021-04-21 19:30:32 +05:30 committed by Mike Salvatore
parent a3fa4663cb
commit af381e062f
1 changed files with 1 additions and 2 deletions

View File

@ -1,6 +1,5 @@
import datetime import datetime
import logging import logging
import os
import subprocess import subprocess
from infection_monkey.utils.auto_new_user import AutoNewUser from infection_monkey.utils.auto_new_user import AutoNewUser
@ -54,7 +53,7 @@ class AutoNewLinuxUser(AutoNewUser):
command_as_new_user = "sudo -u {username} {command}".format( command_as_new_user = "sudo -u {username} {command}".format(
username=self.username, command=command username=self.username, command=command
) )
return os.system(command_as_new_user) return subprocess.call(command_as_new_user, shell=True)
def __exit__(self, exc_type, exc_val, exc_tb): def __exit__(self, exc_type, exc_val, exc_tb):
# delete the user. # delete the user.