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

chromium_applier: Check if module is enabled via policy

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

View File

@ -16,7 +16,10 @@
# 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
)
import logging
import json
@ -26,6 +29,9 @@ from util.logging import slogm
from util.util import is_machine_name
class chromium_applier(applier_frontend):
__module_name = 'chromium_applier'
__module_enabled = True
__module_experimental = True
__registry_branch = 'Software\\Policies\\Google\\Chrome'
__managed_policies_path = '/etc/chromium/policies/managed'
__recommended_policies_path = '/etc/chromium/policies/recommended'
@ -39,6 +45,7 @@ class chromium_applier(applier_frontend):
self.username = username
self._is_machine_name = is_machine_name(self.username)
self.policies = dict()
self.__module_enabled = check_module_enabled(self.storage, self.__module_name, self.__module_enabled)
def get_hklm_string_entry(self, hive_subkey):
query_str = '{}\\{}'.format(self.__registry_branch, hive_subkey)
@ -131,7 +138,9 @@ class chromium_applier(applier_frontend):
'''
All actual job done here.
'''
self.machine_apply()
if self.__module_enabled:
self.machine_apply()
#if not self._is_machine_name:
# logging.debug('Running user applier for Chromium')
# self.user_apply()