Skip to content

Commit

Permalink
Revert prev lint fix (#1604)
Browse files Browse the repository at this point in the history
Fixes #1594:
1. Revert a previous lint fix (in #1529) to avoid using `with` on
subprocesses, as the context manager made local experiments fail to
launch runner instances.
2. Simplify the previous return statement, which was true by definition.
  • Loading branch information
DonggeLiu authored Jan 13, 2023
1 parent 71feb67 commit 2749078
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions common/gcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ def run_local_instance(startup_script: Optional[str] = None) -> bool:
"""Does the equivalent of "create_instance" for local experiments, runs
|startup_script| in the background."""
command = ['/bin/bash', startup_script]
with subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT):
return new_process.ProcessResult(0, '', False)
# pylint: disable=consider-using-with
subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return True


def create_instance_template(template_name, docker_image, env, project, zone):
Expand Down

0 comments on commit 2749078

Please sign in to comment.