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

Merge pull request #111 from altlinux/dc_in_config

Added functionality to tune Samba backend via INI file
This commit is contained in:
NIR 2020-09-07 16:53:56 +04:00 committed by GitHub
commit 91b5c7f858
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -34,6 +34,10 @@ def backend_factory(dc, username, is_machine, no_domain = False):
config = GPConfig()
if config.get_backend() == 'samba' and not no_domain:
if not dc:
dc = config.get_dc()
ld = dict({'dc': dc})
log('D52', ld)
sc = smbcreds(dc)
domain = sc.get_domain()
ldata = dict({'domain': domain})

View File

@ -286,6 +286,9 @@ msgstr "Завершена репликация GPO от контроллера
msgid "Skipping HKCU branch deletion key"
msgstr "Пропускаем специальный ключ удаления ветви реестра HKCU"
msgid "Read domain name from configuration file"
msgstr "Имя контроллера домена для репликации прочитано из файла конфигурации"
msgid "Unknown debug code"
msgstr "Неизвестный отладочный код"

View File

@ -113,6 +113,7 @@ def debug_code(code):
debug_ids[49] = 'Started GPO replication from AD DC'
debug_ids[50] = 'Finished GPO replication from AD DC'
debug_ids[51] = 'Skipping HKCU branch deletion key'
debug_ids[52] = 'Read domain name from configuration file'
return debug_ids.get(code, 'Unknown debug code')

View File

@ -49,6 +49,17 @@ class GPConfig:
self.full_config['gpoa']['backend'] = backend_name
self.write_config()
# This function is not expected corresponding "set_dc()" function
# because we have no way to automatically determine such kind
# of setting.
def get_dc(self):
'''
Fetch Domain Controller from configuration file.
'''
if 'samba' in self.full_config:
if 'dc' in self.full_config['samba']:
return self.full_config['samba']['dc']
def get_local_policy_template(self):
'''
Fetch the name of chosen Local Policy template from