Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sujinmkang committed Nov 20, 2020
1 parent 0bdfb29 commit 3093d0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/sonic-host-services/scripts/process-reboot-cause
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def read_reboot_cause_files_and_save_state_db():
state_db.connect(state_db.STATE_DB)

# Sort the previous reboot cause files by creation time
REBOOT_FILE_LIST = [os.path.join(REBOOT_CAUSE_HISTORY_DIR,i) for i in os.listdir(REBOOT_CAUSE_HISTORY_DIR)]
REBOOT_FILE_LIST = [os.path.join(REBOOT_CAUSE_HISTORY_DIR, i) for i in os.listdir(REBOOT_CAUSE_HISTORY_DIR)]
TIME_SORTED_FULL_REBOOT_FILE_LIST = sorted(REBOOT_FILE_LIST, key=os.path.getmtime, reverse=True)

data = []
# Read each sorted previous reboot cause file and update the state db with previous reboot cause information
for i in range(min(10,len(TIME_SORTED_FULL_REBOOT_FILE_LIST))):
for i in range(min(10, len(TIME_SORTED_FULL_REBOOT_FILE_LIST))):
x = TIME_SORTED_FULL_REBOOT_FILE_LIST[i]
if os.path.isfile(x):
with open(x, "r") as cause_file:
Expand Down
6 changes: 0 additions & 6 deletions src/sonic-host-services/setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from setuptools import setup

dependencies = [
'natsort',
'sonic_py_common',
'swsssdk>=2.0.1',
]

setup(
name = 'sonic-host-services',
version = '1.0',
Expand Down

0 comments on commit 3093d0f

Please sign in to comment.