Bug 44427 - dhclient/linklocal/fallback uses wrong time format
dhclient/linklocal/fallback uses wrong time format
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DHCP
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-21 10:34 CEST by Philipp Hahn
Modified: 2021-05-25 16:02 CEST (History)
0 users

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?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.017
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:
hahn: Patch_Available+


Attachments
Fix lease time format (1.75 KB, patch)
2017-04-21 10:34 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2017-04-21 10:34:49 CEST
Created attachment 8791 [details]
Fix lease time format

print '  expire %d %d/%d/%d %s:%s:%s;' % (d.weekday(), d.year, d.month, d.day, str(d.hour).zfill(2),     str(d.minute).zfill(2), str(d.second).zfill(2))

man 5 dhclient.conf:
> LEASE DECLARATIONS
...
>  Dates are specified as follows:
>   <weekday> <year>/<month>/<day> <hour>:<minute>:<second>
>  The weekday is present to make it easy for a human to tell when a lease expires - it's specified as
>  a number from zero to six, with zero being Sunday.
                                   ^^^^^^^^^^^^^^^^^^
>>> datetime(2017,4,30).isoweekday() # Monday is 1 and Sunday is 7
7
>>> datetime(2017,4,30).weekday()  # Monday is 0 and Sunday is 6
6
>>> datetime(2017,4,30).strftime('%w %a')  # 0 is Sunday and 6 is Saturday
'0 Sun'
Comment 1 Ingo Steuwer univentionstaff 2020-07-03 20:54:08 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.
Comment 2 Philipp Hahn univentionstaff 2020-07-04 16:25:23 CEST
This is still broken and needs to be fixed

[feature/ucs5] b944dfa7d0 Bug #44427: Fix DHCP lease format
 .../conffiles/etc/dhcp/dhclient.conf                    | 17 ++++++++---------
 base/univention-network-manager/debian/changelog        |  6 ++++++
 doc/changelog/changelog-5.0-0.xml                       |  2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)
Comment 3 Florian Best univentionstaff 2020-07-08 01:30:30 CEST
REOPEN:

# ucr set foo=dhcp
Create foo
# ucr commit /etc/dhcp/dhclient.conf
File: /etc/dhcp/dhclient.conf
Traceback (most recent call last):
  File "<stdin>", line 15, in <module>
  File "<stdin>", line 15, in <genexpr>
AttributeError: 'NoneType' object has no attribute 'group'
Comment 4 Philipp Hahn univentionstaff 2020-07-08 11:07:00 CEST
(In reply to Florian Best from comment #3)
> REOPEN:
> 
> # ucr set foo=dhcp
> Create foo
> # ucr commit /etc/dhcp/dhclient.conf
> File: /etc/dhcp/dhclient.conf
> Traceback (most recent call last):
>   File "<stdin>", line 15, in <module>
>   File "<stdin>", line 15, in <genexpr>
> AttributeError: 'NoneType' object has no attribute 'group'

missing `if match` in list comprehension. Fixed:

[feature/ucs5] cbbe5a11f4 fixup! Bug #44427: Fix DHCP lease format
 base/univention-network-manager/conffiles/etc/dhcp/dhclient.conf | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Package: univention-network-manager
Version: 12.0.0-3A~5.0.0.202007081056
Branch: ucs_5.0-0
Comment 5 Florian Best univentionstaff 2020-07-14 13:09:31 CEST
OK: changes
OK: list comprehension
OK: changelog
Comment 6 Florian Best univentionstaff 2021-05-25 16:02:01 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

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