Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint in remote-watch.py #9668

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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