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

Commit

Permalink
Fixed update status function, closed #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Huber committed Aug 16, 2016
1 parent d14cace commit 25727a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions upribox_interface/lib/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def get_update_time(self):
pass

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

0 comments on commit 25727a6

Please sign in to comment.