Skip to content

Commit

Permalink
Fixed: Prevent exception when logging failed git output. See #555
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Feb 17, 2017
1 parent dcf5e08 commit 69f8166
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# NZB Hydra changelog

----------
### 0.2.204
Fixed: Prevent exception when logging failed git output. See [#555](https://github.com/theotherp/nzbhydra/issues/555).

### 0.2.203
Added: Properly log or open browser to ipv6 address. See [#554](https://github.com/theotherp/nzbhydra/issues/554).

Expand Down
12 changes: 6 additions & 6 deletions nzbhydra/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,26 +265,26 @@ def _run_git(self, git_path, args):

if output:
output = output.strip()
logger.info("git output: " + output)
logger.info("git output: %s" % output)

except OSError:
logger.error("Command " + cmd + " didn't work")
logger.error("Command %s didn't work" % cmd)
exit_status = 1

if exit_status == 0:
logger.debug(cmd + " : returned successful")
logger.debug("%s : returned successful" % cmd)
exit_status = 0

elif exit_status == 1:
logger.error(cmd + " returned : " + output)
logger.error("%s returned : %s" % (cmd, output))
exit_status = 1

elif exit_status == 128 or 'fatal:' in output or err:
logger.error(cmd + " returned : " + output)
logger.error("%s returned : %s" % (cmd, output))
exit_status = 128

else:
logger.error(cmd + " returned : " + output + ", treat as error for now")
logger.error("%s returned : %s, treat as error for now" % (cmd, output))
exit_status = 1

return output, err, exit_status
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.203
0.2.204

0 comments on commit 69f8166

Please sign in to comment.