ALT Linux Bugzilla
– Attachment 20520 Details for
Bug 57504
samba-tool некорректно устанавливает и показывает расписание межсайтовой репликации
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Изменения в schedule.py
schedule-with-table.patch (text/plain), 3.66 KB, created by
Vladislav Glinkin
on 2026-01-19 18:32:13 MSK
(
hide
)
Description:
Изменения в schedule.py
Filename:
MIME Type:
Creator:
Vladislav Glinkin
Created:
2026-01-19 18:32:13 MSK
Size:
3.66 KB
patch
obsolete
>diff --git a/schedule.py b/usr/lib64/samba-dc/python3.12/samba/schedule.py >index 2cea8ce..5c8418c 100644 >--- a/schedule.py >+++ b/usr/lib64/samba-dc/python3.12/samba/schedule.py >@@ -27,6 +27,7 @@ from samba.dcerpc import drsblobs > from samba.ndr import ndr_unpack, ndr_pack > > from samba.kcc.kcc_utils import new_connection_schedule >+import time > > > class ScheduleException(Exception): >@@ -57,21 +58,23 @@ def show_schedule(schedule, outf_write, print_legend=False): > """ > > schedule_data = ndr_unpack(drsblobs.schedule, schedule).dataArray[0].slots >+ utc_offset_hours = time.localtime().tm_gmtoff // 3600 > > days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] > >- outf_write("ââ" + ("â" * 2 + "â¬") * 24 + "ââ" + "â\n") >+ outf_write("ââ" + ("â" * 2 + "â¬" + "âââââââââ") * 24 + "ââ" + "â\n") > header = "âD\\Hâ" >- for hour in range(1, 25): >- header += f"{hour:02d}â" >+ for hour in range(24): >+ next_hour = (hour + 1) % 24 >+ header += f"{hour:02d}:00-{next_hour:02d}:00â" > outf_write(f"{header}\n") >- outf_write("ââ" + ("â" * 2 + "â¼") * 24 + "ââ" + "â¤\n") >+ outf_write("ââ" + ("â" * 2 + "â¼" + "âââââââââ") * 24 + "ââ" + "â¤\n") > > for day_idx, day_name in enumerate(days): > day_row = f"â{day_name}â" > > for hour in range(24): >- byte_pos = (day_idx * 24 + hour + 7) % len(schedule_data) >+ byte_pos = (((day_idx + 1) % 7) * 24 + hour - utc_offset_hours) % len(schedule_data) > > symbol = " " > >@@ -82,23 +85,23 @@ def show_schedule(schedule, outf_write, print_legend=False): > enabled_intervals = byte_val & 0x0F > > if enabled_intervals == 0x00: >- symbol = " " # None >+ symbol = " " # None > elif enabled_intervals == 0x01: >- symbol = "ââ" # Once per Hour (only first interval) >+ symbol = " ââ" # Once per Hour (only first interval) > elif enabled_intervals == 0x05: >- symbol = "ââ" # Twice per Hour (first and third intervals) >+ symbol = " ââ" # Twice per Hour (first and third intervals) > elif enabled_intervals == 0x0F: >- symbol = "ââ" # Four Times per Hour (all intervals) >+ symbol = " ââ" # Four Times per Hour (all intervals) > else: > print(len(schedule_data), byte_pos) > >- day_row += symbol + "â" >+ day_row += symbol + " â" > > outf_write(f"{day_row}\n") > if day_idx != 6: >- outf_write("ââ" + ("â" * 2 + "â¼") * 24 + "ââ" + "â¤\n") >+ outf_write("ââ" + ("â" * 2 + "â¼" + "âââââââââ") * 24 + "ââ" + "â¤\n") > >- outf_write("ââ" + ("â" * 2 + "â´") * 24 + "ââ" + "â\n\n") >+ outf_write("ââ" + ("â" * 2 + "â´" + "âââââââââ") * 24 + "ââ" + "â\n\n") > > if print_legend: > outf_write("Legend:\n\n") >@@ -135,10 +138,11 @@ def set_schedule_slot(schedule, day, hour, slot): > unpacked_schedule = ndr_unpack(drsblobs.schedule, schedule) > > schedule_data = unpacked_schedule.dataArray[0].slots >+ utc_offset_hours = time.localtime().tm_gmtoff // 3600 > > day_index = day - 1 > hour_index = hour - 1 >- data_index = (day_index * 24 + hour_index + 7) % len(schedule_data) >+ data_index = (((day_index + 1) % 7) * 24 + hour - utc_offset_hours) % len(schedule_data) > > slot_values = [0x00, 0x01, 0x05, 0x0F] > new_value = slot_values[slot]
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 57504
:
20501
|
20502
| 20520