Univention Bugzilla – Attachment 8164 Details for
Bug 38362
UDM-CLI dies when creating a nagios/service object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
38362.patch (text/plain), 1.71 KB, created by
Florian Best
on 2016-10-30 17:17:24 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-10-30 17:17:24 CET
Size:
1.71 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py >index 5acaf72..5f17f61 100644 >--- a/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py >+++ b/management/univention-directory-manager-modules/modules/univention/admin/handlers/nagios/service.py >@@ -39,6 +39,7 @@ > import univention.admin.handlers > import univention.admin.syntax > import univention.admin.localization >+import univention.admin.uexceptions > from univention.admin import configRegistry > > translation = univention.admin.localization.translation('univention.admin.handlers.nagios') >@@ -377,12 +378,16 @@ def _ldap_modlist(self): > if self.hasChanged('assignedHosts'): > hostlist = [] > for hostdn in self.info.get('assignedHosts', []): >- domain = self.lo.getAttr(hostdn, 'associatedDomain') >- cn = self.lo.getAttr(hostdn, 'cn') >- if not domain: >- domain = [configRegistry.get("domainname")] >- fqdn = "%s.%s" % (cn[0], domain[0]) >- hostlist.append(fqdn) >+ try: >+ host = self.lo.get(hostdn, ['associatedDomain', 'cn'], required=True) >+ cn = host['cn'] >+ except univention.admin.uexceptions.noObject: >+ raise univention.admin.uexceptions.valueError('%r does not exists' % (hostdn,)) >+ except KeyError: >+ raise univention.admin.uexceptions.valueError('%r has no cn attribute' % (hostdn,)) >+ >+ domain = host.get('associatedDomain', [configRegistry.get("domainname")]) >+ hostlist.append("%s.%s" % (cn[0], domain[0])) > > ml.insert(0, ('univentionNagiosHostname', self.oldattr.get('univentionNagiosHostname', []), hostlist)) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38362
: 8164