Univention Bugzilla – Attachment 8791 Details for
Bug 44427
dhclient/linklocal/fallback uses wrong time format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix lease time format
file_44427.txt (text/plain), 1.75 KB, created by
Philipp Hahn
on 2017-04-21 10:34:49 CEST
(
hide
)
Description:
Fix lease time format
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2017-04-21 10:34:49 CEST
Size:
1.75 KB
patch
obsolete
>diff --git a/base/univention-network-manager/conffiles/etc/dhcp/dhclient.conf b/base/univention-network-manager/conffiles/etc/dhcp/dhclient.conf >index 7cdf8ce101..2fa39bda7d 100644 >--- a/base/univention-network-manager/conffiles/etc/dhcp/dhclient.conf >+++ b/base/univention-network-manager/conffiles/etc/dhcp/dhclient.conf >@@ -71,9 +71,8 @@ reboot 5; > #} > @!@ > import random >-import time > import os.path >-from datetime import datetime >+from datetime import datetime, timedelta > > if configRegistry.is_true('dhclient/linklocal/fallback', True): > for k in configRegistry.keys(): >@@ -87,7 +86,7 @@ if configRegistry.is_true('dhclient/linklocal/fallback', True): > if not current_addr.startswith('169.254.'): > current_addr = '169.254.%s.%s' % (r1, r2) > >- d = datetime.fromtimestamp(time.time() + (6*3600)) # expire in six hours >+ d = datetime.now() + timedelta(hours=6) # expire in six hours > > print 'lease {' > print ' interface "%s";' % (iface) >@@ -95,7 +94,7 @@ if configRegistry.is_true('dhclient/linklocal/fallback', True): > print ' option subnet-mask 255.255.0.0;' > print ' option broadcast-address 169.254.255.255;' > # Format form 'man dhclient.conf: <weekday> <year>/<month>/<day> <hour>:<minute>:<second> >- 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)) >+ print d.strftime(' expire %w %Y/%m/%d %H:%M:%S;') > print '}' > > LOCAL = '/etc/dhcp/dhclient.conf.local'
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 44427
: 8791