Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 25727a6

Browse files
author
Markus Huber
committed
Fixed update status function, closed #13
1 parent d14cace commit 25727a6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

upribox_interface/lib/info.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ def get_update_time(self):
144144
pass
145145

146146
def get_upgrade_status(self):
147-
with open(self.ANSIBLE_PULL_LOG_FILE) as pull_log_file:
148-
pull_log = '\n'.join(pull_log_file.readlines())
149-
search_term = 'failed='
150-
fail_index = pull_log.rfind(search_term)
151-
failed_num = int(pull_log[fail_index + len(search_term)])
152-
if failed_num == 0:
153-
self.upgrade_successful = True
147+
try:
148+
with open(self.ANSIBLE_PULL_LOG_FILE) as pull_log_file:
149+
pull_log = '\n'.join(pull_log_file.readlines())
150+
if '"failed": true' not in pull_log:
151+
self.upgrade_successful = True
152+
except:
153+
pass

0 commit comments

Comments
 (0)