mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-08-25 05:49:25 +03:00
Compare commits
2 Commits
0.8.2-alt1
...
binary_mod
Author | SHA1 | Date | |
---|---|---|---|
8292aa69b3
|
|||
aa03e6dfa4
|
@ -41,8 +41,13 @@ from util.users import (
|
|||||||
with_privileges
|
with_privileges
|
||||||
)
|
)
|
||||||
from util.logging import slogm
|
from util.logging import slogm
|
||||||
|
from util.paths import (
|
||||||
|
frontend_module_dir
|
||||||
|
)
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
def determine_username(username=None):
|
def determine_username(username=None):
|
||||||
'''
|
'''
|
||||||
@ -72,6 +77,12 @@ class frontend_manager:
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, username, is_machine):
|
def __init__(self, username, is_machine):
|
||||||
|
frontend_module_files = frontend_module_dir().glob('**/*')
|
||||||
|
self.frontend_module_binaries = list()
|
||||||
|
for exe in frontend_module_files:
|
||||||
|
if (exe.is_file() and os.access(exe.resolve(), os.X_OK)):
|
||||||
|
self.frontend_module_binaries.append(exe)
|
||||||
|
|
||||||
self.storage = registry_factory('registry')
|
self.storage = registry_factory('registry')
|
||||||
self.username = determine_username(username)
|
self.username = determine_username(username)
|
||||||
self.is_machine = is_machine
|
self.is_machine = is_machine
|
||||||
@ -105,6 +116,10 @@ class frontend_manager:
|
|||||||
logging.error('Not sufficient privileges to run machine appliers')
|
logging.error('Not sufficient privileges to run machine appliers')
|
||||||
return
|
return
|
||||||
logging.debug(slogm('Applying computer part of settings'))
|
logging.debug(slogm('Applying computer part of settings'))
|
||||||
|
|
||||||
|
for exe in self.frontend_module_binaries:
|
||||||
|
subprocess.check_call([exe.resolve()])
|
||||||
|
|
||||||
self.machine_appliers['systemd'].apply()
|
self.machine_appliers['systemd'].apply()
|
||||||
self.machine_appliers['control'].apply()
|
self.machine_appliers['control'].apply()
|
||||||
self.machine_appliers['polkit'].apply()
|
self.machine_appliers['polkit'].apply()
|
||||||
|
@ -59,3 +59,31 @@ def local_policy_cache():
|
|||||||
|
|
||||||
return lpcache
|
return lpcache
|
||||||
|
|
||||||
|
def backend_module_dir():
|
||||||
|
backend_dir = '/usr/lib/gpoa/backend'
|
||||||
|
return pathlib.Path(backend_dir)
|
||||||
|
|
||||||
|
def frontend_module_dir():
|
||||||
|
frontend_dir = '/usr/lib/gpoa/frontend'
|
||||||
|
return pathlib.Path(frontend_dir)
|
||||||
|
|
||||||
|
def storage_module_dir():
|
||||||
|
storage_dir = '/usr/lib/gpoa/storage'
|
||||||
|
return pathlib.Path(storage_dir)
|
||||||
|
|
||||||
|
def pre_backend_plugin_dir():
|
||||||
|
pre_backend_dir = '/usr/lib/gpoa/backend_pre'
|
||||||
|
return pathlib.Path(pre_backend_dir)
|
||||||
|
|
||||||
|
def post_backend_plugin_dir():
|
||||||
|
post_backend_dir = '/usr/lib/gpoa/backend_post'
|
||||||
|
return pathlib.Path(post_backend_dir)
|
||||||
|
|
||||||
|
def pre_frontend_plugin_dir():
|
||||||
|
pre_forntend_dir = '/usr/lib/gpoa/frontend_pre'
|
||||||
|
return pathlib.Path(pre_frontend_dir)
|
||||||
|
|
||||||
|
def post_frontend_plugin_dir():
|
||||||
|
post_frontend_dir = '/usr/lib/gpoa/frontend_post'
|
||||||
|
return pathlib.Path(post_frontend_dir)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user