1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

gpupdate-setup/rollback_on_error()

This is helper function for consistent Group Policy disabling in case
of any errors while enabling Group Policies.
This commit is contained in:
Игорь Чудов 2020-08-17 19:19:22 +04:00
parent 53b94246a8
commit f9cef07151
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -183,6 +183,11 @@ def get_active_policy_name():
return actual_policy_name
def rollback_on_error(command_name):
if 0 != runcmd(command_name)[0]:
disable_gp()
return False
return True
def disable_gp():
cmd_set_global_policy = ['/usr/sbin/control', 'system-policy', 'global']