Skip to content

Commit

Permalink
Fix lint in remote-watch.py (#9668)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Jul 23, 2020
1 parent 75b2fc4 commit 8df25b2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions ci/remote-watch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python

"""
This command must be run in a git repository.
Expand Down Expand Up @@ -202,8 +201,8 @@ def monitor():
expected_line = "{}\t{}".format(expected_sha, ref)

if should_keep_alive(git("show", "-s", "--format=%B", "HEAD^-")):
logger.info("Not monitoring %s on %s due to keep-alive on: %s",
ref, remote, expected_line)
logger.info("Not monitoring %s on %s due to keep-alive on: %s", ref,
remote, expected_line)
return

logger.info("Monitoring %s (%s) for changes in %s: %s", remote,
Expand All @@ -224,14 +223,15 @@ def monitor():
ref, remote, expected_line)
break
elif status != 0:
logger.error("Error %d: unable to check %s on %s: %s",
status, ref, remote, expected_line)
logger.error("Error %d: unable to check %s on %s: %s", status, ref,
remote, expected_line)
else:
expected_line = detect_spurious_commit(line, expected_line, remote)
if expected_line != line:
logger.info("Terminating job as %s has been updated on %s\n"
" from:\t%s\n"
" to: \t%s", ref, remote, expected_line, line)
logger.info(
"Terminating job as %s has been updated on %s\n"
" from:\t%s\n"
" to: \t%s", ref, remote, expected_line, line)
time.sleep(1) # wait for CI to flush output
break

Expand All @@ -253,8 +253,10 @@ def main(program, *args):


if __name__ == "__main__":
logging.basicConfig(format="%(levelname)s: %(message)s",
stream=sys.stderr, level=logging.DEBUG)
logging.basicConfig(
format="%(levelname)s: %(message)s",
stream=sys.stderr,
level=logging.DEBUG)
try:
raise SystemExit(main(*sys.argv) or 0)
except KeyboardInterrupt:
Expand Down

0 comments on commit 8df25b2

Please sign in to comment.