Skip to content

Commit

Permalink
common: Fix FRU display error in log-util (facebook#98)
Browse files Browse the repository at this point in the history
Summary:
FRU number always shows one digit even if there are two.
Modify the display rule to correct it.

Example:

Before modify:

1    scm      2018-10-17 02:09:45    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 12, num: 0x17 curr_val: 9024.00 RPM, thresh_val: 8500.00 RPM, snr: PSU2_FAN_SPEED
1    scm      2018-10-17 02:09:47    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 13, num: 0x24 curr_val: 9024.00 RPM, thresh_val: 8500.00 RPM, snr: PSU3_FAN_SPEED
1    scm      2018-10-17 02:09:48    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 14, num: 0x31 curr_val: 8992.00 RPM, thresh_val: 8500.00 RPM, snr: PSU4_FAN_SPEED

After modify:

12   psu2     2018-10-17 02:09:45    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 12, num: 0x17 curr_val: 9024.00 RPM, thresh_val: 8500.00 RPM, snr: PSU2_FAN_SPEED
13   psu3     2018-10-17 02:09:47    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 13, num: 0x24 curr_val: 9024.00 RPM, thresh_val: 8500.00 RPM, snr: PSU3_FAN_SPEED
14   psu4     2018-10-17 02:09:48    sensord          ASSERT: Upper Non Critical threshold - raised - FRU: 14, num: 0x31 curr_val: 8992.00 RPM, thresh_val: 8500.00 RPM, snr: PSU4_FAN_SPEED
Pull Request resolved: facebookexternal/openbmc.accton#98

Test Plan: Test on minipack: pass

Reviewed By: amithash

fbshipit-source-id: a28726d45
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Oct 23, 2018
1 parent 299a3d8 commit 46c9c3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/recipes-core/log-util/files/log-util.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def log_main():
if re.search(r'FRU: [0-9]{1,2}', log, re.IGNORECASE):
fru_num = ''.join(re.findall(r'FRU: [0-9]{1,2}', log, re.IGNORECASE))
# FRU is in format "FRU: X"
fru_num = fru_num[5]
fru_num = fru_num.split(" ")[1]
else:
fru_num = '0'

Expand Down Expand Up @@ -199,7 +199,7 @@ def log_main():
if re.search(r'FRU: [0-9]{1,2}', log, re.IGNORECASE):
fru_num = ''.join(re.findall(r'FRU: [0-9]{1,2}', log, re.IGNORECASE))
# FRU is in format "FRU: X"
fru_num = fru_num[5]
fru_num = fru_num.split(" ")[1]
else:
fru_num = '0'

Expand Down

0 comments on commit 46c9c3e

Please sign in to comment.