Bug 52814 - During upgrade to UCS 5.0: AttributeError: 'IPv4Interface' object has no attribute 'masked'
During upgrade to UCS 5.0: AttributeError: 'IPv4Interface' object has no attr...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 4.4-7-errata
Assigned To: Florian Best
Jürn Brodersen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-19 14:12 CET by Florian Best
Modified: 2023-05-02 18:06 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-02-19 14:12:31 CET
The updater.log contains these tracebacks during upgrade of univention-base-files:

Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
AttributeError: 'IPv4Interface' object has no attribute 'masked'
Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
AttributeError: 'IPv4Interface' object has no attribute 'masked'
Traceback (most recent call last):
  File "<stdin>", line 30, in <module>
AttributeError: 'IPv4Interface' object has no attribute 'prefixlen'

Full log in attachment 10626 [details].

This comes from the UCR templates:
services/univention-printserver/conffiles/etc/cups/cupsd.conf.d/01cupsd-base:           print('    Allow From %s' % (iface.ipv4_address().masked().with_netmask,))                                                                            
services/univention-printserver/conffiles/etc/cups/cupsd.conf.d/01cupsd-base:           print('    Allow From %s' % (iface.ipv4_address().masked().with_netmask,))

and:

services/univention-squid/conffiles/etc/squid/squid.conf:       return (str(ip.network_address), ip.prefixlen)
services/univention-squid/conffiles/etc/squid/squid.conf:               myNetworks[str(ipv4_address.network)] = ipv4_address.prefixlen                                                                                                        
services/univention-squid/conffiles/etc/squid/squid.conf:       myNetworks.update({str(ip.network): ip.prefixlen for ip in ipv6_addresses if ip})


Currently I am unsure how to solve this.
Comment 1 Florian Best univentionstaff 2021-03-06 11:45:17 CET
Keep it simple by just making the templates forward-compatible.
No merge to UCS 5 necessary.

univention-squid.yaml
37ee8e7261f1 | YAML Bug #52814

univention-squid (12.0.2-2)
957723506f7a | Bug #52814: make UCR template compatible with UCS 5.0/Python 3

univention-printserver.yaml
37ee8e7261f1 | YAML Bug #52814

univention-printserver (12.0.1-17)
ef2b987b3ece | Bug #52814: make UCR template compatible with UCS 5.0/Python 3
Comment 2 Jürn Brodersen univentionstaff 2021-03-15 15:14:48 CET
Fixed a problem in squid.conf:

[4.4-7 f1a27dfed3] Bug #52814: fix double netmask e.g. 1.2.3.4/24/24
[4.4-7 c1e597301f] Bug #52814: yaml

What I tested:
with python2 (on a ucs4 system) and python3 (python3 on a ucs5 system)
"ucr commit /etc/cups/cupsd.conf /etc/squid/squid.conf" -> OK
yaml -> OK
jenkins -> OK

-> verified