View | Details | Raw Unified | Return to bug 45904
Collapse All | Expand All

(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/46_kerberos_ddns_update.py (-5 / +25 lines)
 Lines 36-41   import contextlib Link Here 
36
36
37
import univention.lib.admember
37
import univention.lib.admember
38
import univention.config_registry
38
import univention.config_registry
39
import univention.admin.uldap
39
from univention.management.console.modules.diagnostic import Critical
40
from univention.management.console.modules.diagnostic import Critical
40
from univention.management.console.modules.diagnostic import util
41
from univention.management.console.modules.diagnostic import util
41
42
 Lines 116-132   def check_dns_server_principal(hostname, domainname): Link Here 
116
		nsupdate(hostname, hostname, domainname)
117
		nsupdate(hostname, hostname, domainname)
117
118
118
119
120
def is_s4_domain(config_registry):
121
	ldap_hostdn = config_registry.get('ldap/hostdn')
122
	(ldap_connection, position) = univention.admin.uldap.getMachineConnection()
123
	filter_expression = '(univentionService=S4 Connector)'
124
	res = ldap_connection.search(filter=filter_expression)
125
	if res:
126
		return True
127
	return False
128
129
def has_service_samba_or_samba4(config_registry):
130
	ldap_hostdn = config_registry.get('ldap/hostdn')
131
	(ldap_connection, position) = univention.admin.uldap.getMachineConnection()
132
	filter_expression = '(|(univentionService=Samba 3)(univentionService=Samba 4))'
133
	res = ldap_connection.search(base=ldap_hostdn, filter=filter_expression)
134
	if res:
135
		return True
136
	return False
137
119
def check_nsupdate(config_registry):
138
def check_nsupdate(config_registry):
120
	server = get_server(config_registry)
139
	server = get_server(config_registry)
121
	hostname = config_registry.get('hostname')
140
	hostname = config_registry.get('hostname')
122
	domainname = config_registry.get('domainname')
141
	domainname = config_registry.get('domainname')
123
	is_dc = config_registry.get('samba4/role') == 'DC'
124
142
125
	try:
143
	if is_s4_domain() and has_service_samba_or_samba4(config_registry):
126
		check_dns_machine_principal(server, hostname, domainname)
144
		try:
127
	except UpdateError as error:
145
			check_dns_machine_principal(server, hostname, domainname)
128
		yield error
146
		except UpdateError as error:
147
			yield error
129
148
149
	is_dc = config_registry.get('samba4/role') == 'DC'
130
	if is_dc:
150
	if is_dc:
131
		try:
151
		try:
132
			check_dns_server_principal(hostname, domainname)
152
			check_dns_server_principal(hostname, domainname)

Return to bug 45904