Skip to content

Commit a2728cb

Browse files
authored
[pfcwd] Use floor division in Python3 (sonic-net#1277)
Fix the float division due to recent transfer to Python3, use floor division instead to generate integer result in the PFCWD detect/restore time calculation. Signed-off-by: Longxiang Lyu <[email protected]>
1 parent 24ffa25 commit a2728cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pfcwd/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def start_default(self):
359359
port_num = len(list(self.config_db.get_table('PORT').keys()))
360360

361361
# Paramter values positively correlate to the number of ports.
362-
multiply = max(1, (port_num-1)/DEFAULT_PORT_NUM+1)
362+
multiply = max(1, (port_num-1)//DEFAULT_PORT_NUM+1)
363363
pfcwd_info = {
364364
'detection_time': DEFAULT_DETECTION_TIME * multiply,
365365
'restoration_time': DEFAULT_RESTORATION_TIME * multiply,

0 commit comments

Comments
 (0)