Bug 42849 - Traceback: udm list --policies on dhcp/host entries without an fixed address
Traceback: udm list --policies on dhcp/host entries without an fixed address
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2
Assigned To: Philipp Hahn
Florian Best
: interim-1
Depends on: 34764
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-04 09:23 CET by Philipp Hahn
Modified: 2017-04-04 18:28 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016110221000461
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2016-11-04 09:23:44 CET
# udm dhcp/host list --superordinate $(udm dhcp/service list|sed -ne 's/^DN: //p;T;q') --policies 0
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 222, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 404, in doit
    out = _doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 1065, in _doit
    if univention.admin.ipaddress.ip_is_in_network(subnet['subnet'], subnet['subnetmask'], object['fixedaddress'][0]):
IndexError: list index out of range


# univention-ldapsearch -LLLo ldif-wrap=no -b cn=dhcp,$(ucr get ldap/base)
dn: cn=dhcp,dc=phahn,dc=qa
objectClass: organizationalRole
objectClass: univentionObject
univentionObjectType: container/cn
description: Containing all DHCP Objects as per default Settings
cn: dhcp

dn: cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
objectClass: top
objectClass: dhcpOptions
objectClass: univentionDhcpService
objectClass: univentionObject
univentionObjectType: dhcp/service
cn: phahn.qa

dn: cn=sss,cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
objectClass: top
objectClass: univentionObject
objectClass: univentionDhcpHost
univentionObjectType: dhcp/host
cn: sss
dhcpHWAddress: ethernet 00:11:22:33:44:55

dn: cn=master41,cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
objectClass: top
objectClass: univentionObject
objectClass: dhcpServer
dhcpServiceDN: cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
univentionObjectType: dhcp/server
cn: master41

dn: cn=10.200.17.0,cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
objectClass: top
objectClass: univentionDhcpSubnet
objectClass: univentionObject
objectClass: univentionPolicyReference
univentionObjectType: dhcp/subnet
cn: 10.200.17.0
dhcpNetMask: 24
univentionPolicyReference: cn=default-settings,cn=boot,cn=dhcp,cn=policies,dc=phahn,dc=qa
univentionPolicyReference: cn=default-settings,cn=dns,cn=dhcp,cn=policies,dc=phahn,dc=qa
univentionPolicyReference: cn=default-settings,cn=routing,cn=dhcp,cn=policies,dc=phahn,dc=qa

dn: cn=foo,cn=10.200.17.0,cn=phahn.qa,cn=dhcp,dc=phahn,dc=qa
objectClass: top
objectClass: univentionDhcpPool
objectClass: univentionObject
dhcpPermitList: deny all clients
univentionObjectType: dhcp/pool
cn: foo
dhcpRange: 10.200.17.1 10.200.17.1
Comment 1 Philipp Hahn univentionstaff 2016-11-04 10:18:39 CET
Another TB when multiple dhcp/services with different dhcp/subnets are defined (regression from Bug #34764):

# /usr/share/pyshared/univention/admincli/admin.py dhcp/host list --superordinate "cn=test$R,$LB" --policies 0
Traceback (most recent call last):
  File "/usr/share/pyshared/univention/admincli/admin.py", line 1126, in <module>
    print '\n'.join(doit(sys.argv))
  File "/usr/share/pyshared/univention/admincli/admin.py", line 394, in doit
    out=_doit(arglist)
  File "/usr/share/pyshared/univention/admincli/admin.py", line 1055, in _doit
    for subnet in univention.admin.modules.lookup(subnet_module, co, lo, scope='sub', superordinate=superordinate, base='', filter=''):
  File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 721, in lookup
    tmpres=module.lookup(co, lo, filter, base=base, superordinate=superordinate, scope=scope, unique=unique, required=required, timeout=timeout, sizelimit=sizelimit)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/dhcp/subnet.py", line 180, in lookup
    res.append((object(co, lo, None, dn=dn, superordinate=superordinate, attributes = attrs )))
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 572, in __init__
    self._validate_superordinate()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 622, in _validate_superordinate
    raise univention.admin.uexceptions.insufficientInformation(_('The DN must be underneath of the superordinate.'))
univention.admin.uexceptions.insufficientInformation: The DN must be underneath of the superordinate.

r74103 | Bug #42849 udm: Fix policy listing for dhcp/host entries

Package: univention-directory-manager-modules
Version: 12.0.5-2A~4.2.0.201611041015
Branch: ucs_4.2-0
Comment 2 Florian Best univentionstaff 2016-12-22 16:41:59 CET
OK: multiple services
OK: host without fixed address
OK: host with 3 fixed addresses
OK: Changelog
Comment 3 Stefan Gohmann univentionstaff 2017-04-04 18:28:49 CEST
UCS 4.2 has been released:
 https://docs.software-univention.de/release-notes-4.2-0-en.html
 https://docs.software-univention.de/release-notes-4.2-0-de.html

If this error occurs again, please use "Clone This Bug".