parent
a3fa4663cb
commit
af381e062f
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue