Bug 55196 - Creating an ipmanagedclient with multiple IPs leads to traceback
Creating an ipmanagedclient with multiple IPs leads to traceback
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
: python3-migration
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-12 13:33 CEST by Julia Bremer
Modified: 2022-09-26 11:45 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very 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.034
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022091121000132
Bug group (optional): bitesize, Regression, Workaround is available
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julia Bremer univentionstaff 2022-09-12 13:33:14 CEST
Creating an ipmanagedclient like
computers/ipmanagedclient create --position cn=computers,$(ucr get ldap/base) --set name='test' --set network=cn=default,cn=networks,$(ucr get ldap/base) --append ip=10.200.21.20 --append ip=10.200.21.21

raises

Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 241, in doit
    univention.admincli.admin.main(arglist, stdout, stderr)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 354, in main
    _doit(arglist, stdout=stdout, stderr=stderr)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 620, in _doit
    cli.create(input, append, ignore_exists, parsed_options, parsed_append_options, parsed_remove_options, policy_reference)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 648, in create
    return self._create(self.module_name, self.module, self.dn, self.lo, self.position, self.superordinate, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 683, in _create
    object_input(module, object, input, append=append, stderr=self.stderr)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 339, in object_input
    object[key] = value
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 3341, in __setitem__
    if not ips or ip_address(u'%s' % (ip1,)) not in subnet:
  File "/usr/lib/python3.7/ipaddress.py", line 54, in ip_address
    address)
ValueError: '' does not appear to be an IPv4 or IPv6 address



This seems to be a regression from Bug #50648 from commit e4f22d87dcf
where these lines have been added:
ip1 = self['ip'][0] if len(ips) == 1 else ''
and I'd guess they should be
ip1 = self['ip'][0] if len(ips) >= 1 else ''
to account for multiple ips.
Comment 1 Erik Damrose univentionstaff 2022-09-12 15:04:50 CEST
Workaround: Only add one ip address at a time