Fixes the logon type to service login

Change-Id: Ie53ce192eff2069769b6bb5b56fc9d5058ec8156
Signed-off-by: Zhongcheng Lao <zhongchengl@vmware.com>
This commit is contained in:
Zhongcheng Lao 2024-03-06 17:00:36 +08:00
parent 036aa1641b
commit 8bf9ce6f86
2 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class InitManager(object):
LOG.info("Respawning current process with updated credentials.")
token = osutils.create_user_logon_session(
service_user, service_password, service_domain,
logon_type=osutils.LOGON32_LOGON_BATCH)
logon_type=osutils.LOGON32_LOGON_SERVICE)
exit_code = osutils.execute_process_as_user(token, arguments)
LOG.info("Process execution ended with exit code: %s", exit_code)
sys.exit(exit_code)

View File

@ -375,7 +375,7 @@ class TestInitManager(unittest.TestCase):
else:
self.osutils.create_user_logon_session.assert_called_once_with(
credentials[1], credentials[2], credentials[0],
logon_type=self.osutils.LOGON32_LOGON_BATCH)
logon_type=self.osutils.LOGON32_LOGON_SERVICE)
self.osutils.execute_process_as_user.assert_called_once_with(
token, arguments)
mock_exit.assert_called_once_with(0)