Univention Bugzilla – Attachment 6550 Details for
Bug 33527
No proper error message if IP address pool is empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
33527.patch (text/plain), 3.74 KB, created by
Florian Best
on 2014-12-17 17:59:33 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2014-12-17 17:59:33 CET
Size:
3.74 KB
patch
obsolete
>diff --git a/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/__init__.py b/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/__init__.py >index ed487b9..3678a21 100644 >--- a/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/__init__.py >+++ b/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/__init__.py >@@ -50,7 +50,7 @@ from univention.management.console.modules import Base, UMC_OptionTypeError, UMC > from univention.management.console.modules.decorators import simple_response, sanitize, multi_response > from univention.management.console.modules.sanitizers import ( > LDAPSearchSanitizer, EmailSanitizer, ChoicesSanitizer, >- ListSanitizer, StringSanitizer, DictSanitizer >+ ListSanitizer, StringSanitizer, DictSanitizer, BooleanSanitizer > ) > from univention.management.console.modules.mixins import ProgressMixin > from univention.management.console.log import MODULE >@@ -644,6 +644,10 @@ class Instance(Base, ProgressMixin): > result = module.get_default_values(property_name) > self.finished(request.id, result) > >+ @sanitize( >+ networkDN=StringSanitizer(required=True), >+ increaseCounter=BooleanSanitizer(default=False) >+ ) > def network(self, request): > """Returns the next IP configuration based on the given network object > >@@ -653,12 +657,11 @@ class Instance(Base, ProgressMixin): > > return: {} > """ >- self.required_options(request, 'networkDN') > module = self._get_module('networks/network') > obj = module.get(request.options['networkDN']) > > if not obj: >- raise UMC_OptionTypeError('Could not find network object') >+ raise ObjectDoesNotExists(request.options['networkDN']) > try: > obj.refreshNextIp() > except udm_errors.nextFreeIp: >@@ -667,7 +670,7 @@ class Instance(Base, ProgressMixin): > result = {'ip': obj['nextIp'], 'dnsEntryZoneForward': obj['dnsEntryZoneForward'], 'dhcpEntryZone': obj['dhcpEntryZone'], 'dnsEntryZoneReverse': obj['dnsEntryZoneReverse']} > self.finished(request.id, result) > >- if request.options.get('increaseCounter', False) == True: >+ if request.options['increaseCounter']: > # increase the next free IP address > obj.stepIp() > obj.modify() >diff --git a/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py b/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py >index 0b50de2..182750d 100644 >--- a/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py >+++ b/ucs-4.0-0/management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py >@@ -266,19 +266,20 @@ class SuperordinateDoesNotExists(ObjectDoesNotExists): > yield _('Superordinate %s could not be found.') % (self.ldap_dn,) > yield _('It possibly has been deleted or moved. Please update your search results and open the object again.') > >+ > class NoIpLeft(UMCError): > >- def __init__(self, networkDN): >- self.networkName = (udm.uldap.explodeDn(networkDN)[0]).split('=')[1] >+ def __init__(self, ldap_dn): >+ try: >+ self.network_name = udm.uldap.explodeDn(ldap_dn, True)[0] >+ except IndexError: >+ self.network_name = ldap_dn > super(NoIpLeft, self).__init__() > > def _error_msg(self): >- >- yield _('Failed to automatically assign an IP address.') >- yield _('All IP addresses in the specified network "%s" are already in use.') % (self.networkName,) >- yield _('Please specify a different network or make sure that free IP addresses are available.') >- >- >+ yield _('Failed to automatically assign an IP address.') >+ yield _('All IP addresses in the specified network "%s" are already in use.') % (self.network_name,) >+ yield _('Please specify a different network or make sure that free IP addresses are available.') > > > class UDM_Error(Exception):
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 33527
: 6550