Univention Bugzilla – Attachment 7079 Details for
Bug 39069
AD Takeover of English AD with German UCS fails during time sync
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
LC_TIME.patch
LC_TIME.patch (text/plain), 1.24 KB, created by
Arvid Requate
on 2015-08-03 15:12:56 CEST
(
hide
)
Description:
LC_TIME.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2015-08-03 15:12:56 CEST
Size:
1.24 KB
patch
obsolete
>Index: umc/python/adtakeover/takeover.py >=================================================================== >--- umc/python/adtakeover/takeover.py (Revision 60906) >+++ umc/python/adtakeover/takeover.py (Arbeitskopie) >@@ -62,6 +62,7 @@ > import univention.lib > import univention.lib.s4 > from datetime import datetime, timedelta >+import locale > import univention.config_registry > # from samba.netcmd.common import netcmd_get_domain_infos_via_cldap > from samba.dcerpc import nbt >@@ -801,10 +802,15 @@ > return False > > TIME_FORMAT = "%a %b %d %H:%M:%S %Z %Y" >+ time_string = stdout.strip() >+ old_locale = locale.getlocale(locale.LC_TIME) > try: >- remote_datetime = datetime.strptime(stdout.strip(), TIME_FORMAT) >+ locale.setlocale(locale.LC_TIME, (None, None)) # 'C' as env['LC_ALL'] some lines earlier >+ remote_datetime = datetime.strptime(time_string, TIME_FORMAT) > except ValueError as ex: >- raise TimeSynchronizationFailed(_("AD Server did not return proper time string: %s.") % (stdout.strip(),)) >+ raise TimeSynchronizationFailed(_("AD Server did not return proper time string: %s.") % (time_string,)) >+ finally: >+ locale.setlocale(locale.LC_TIME, old_locale) > > local_datetime = datetime.today() > delta_t = local_datetime - remote_datetime
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 39069
: 7079