Skip to content
Snippets Groups Projects
Commit 27f39c94 authored by Martin Blanchard's avatar Martin Blanchard
Browse files

_app/commands: Move 'wait' from 'execute' to 'operation'

parent 6362346c
No related branches found
No related tags found
Loading
......@@ -97,20 +97,6 @@ def request_dummy(context, number, wait_for_completion):
context.logger.info(next(response))
@cli.command('wait', short_help="Streams an operation until it is complete.")
@click.argument('operation-name', nargs=1, type=click.STRING, required=True)
@pass_context
def wait_execution(context, operation_name):
stub = remote_execution_pb2_grpc.ExecutionStub(context.channel)
request = remote_execution_pb2.WaitExecutionRequest(instance_name=context.instance_name,
name=operation_name)
response = stub.WaitExecution(request)
for stream in response:
context.logger.info(stream)
@cli.command('command', short_help="Send a command to be executed.")
@click.option('--output-file', nargs=2, type=(click.STRING, click.BOOL), multiple=True,
help="Tuple of expected output file and is-executeable flag.")
......
......@@ -32,7 +32,7 @@ from buildgrid._protos.google.longrunning import operations_pb2, operations_pb2_
from ..cli import pass_context
@click.group(name='operation', short_help="Long running operations commands")
@click.group(name='operation', short_help="Long running operations commands.")
@click.option('--remote', type=click.STRING, default='http://localhost:50051', show_default=True,
help="Remote execution server's URL (port defaults to 50051 if no specified).")
@click.option('--client-key', type=click.Path(exists=True, dir_okay=False), default=None,
......@@ -93,3 +93,17 @@ def lists(context):
for op in response.operations:
context.logger.info(op)
@cli.command('wait', short_help="Streams an operation until it is complete.")
@click.argument('operation-name', nargs=1, type=click.STRING, required=True)
@pass_context
def wait(context, operation_name):
stub = remote_execution_pb2_grpc.ExecutionStub(context.channel)
request = remote_execution_pb2.WaitExecutionRequest(instance_name=context.instance_name,
name=operation_name)
response = stub.WaitExecution(request)
for stream in response:
context.logger.info(stream)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment