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

systemd_applier: Check if module is enabled via policy

This commit is contained in:
Игорь Чудов 2020-06-26 17:58:16 +04:00
parent c0a2b13da5
commit eb8cf25690
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -16,19 +16,26 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .applier_frontend import applier_frontend
from .applier_frontend import (
applier_frontend
, check_module_enabled
)
from .appliers.systemd import systemd_unit
from util.logging import slogm
import logging
class systemd_applier(applier_frontend):
__module_name = 'systemd_applier'
__module_experimental = False
__module_enabled = True
__registry_branch = 'Software\\BaseALT\\Policies\\SystemdUnits'
def __init__(self, storage):
self.storage = storage
self.systemd_unit_settings = self.storage.filter_hklm_entries('Software\\BaseALT\\Policies\\SystemdUnits%')
self.units = []
self.__module_enabled = check_module_enabled(self.storage, self.__module_name, self.__module_enabled)
def apply(self):
'''
@ -48,6 +55,9 @@ class systemd_applier(applier_frontend):
logging.error(slogm('Failed applying unit {}'.format(unit.unit_name)))
class systemd_applier_user(applier_frontend):
__module_name = 'systemd_applier_user'
__module_experimental = False
__module_enabled = True
__registry_branch = 'Software\\BaseALT\\Policies\\SystemdUnits'
def __init__(self, storage, sid, username):