diff options
author | Antonio Terceiro <antonio.terceiro@linaro.org> | 2014-05-08 17:31:00 -0300 |
---|---|---|
committer | Antonio Terceiro <antonio.terceiro@linaro.org> | 2014-05-08 17:31:00 -0300 |
commit | 81851a347313d3b13e8f982892feb6affc9043f9 (patch) | |
tree | b51fe098b45908ae517129c05d62dd353af41466 | |
parent | 2d19233628817ed9472ca652fed992c6897a1bff (diff) |
Imported Upstream version 0.11
-rw-r--r-- | PKG-INFO | 2 | ||||
-rw-r--r-- | lava/tool/__init__.py | 2 | ||||
-rw-r--r-- | lava_scheduler_tool/commands.py | 21 | ||||
-rw-r--r-- | lava_tool.egg-info/PKG-INFO | 2 |
4 files changed, 24 insertions, 3 deletions
@@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: lava-tool -Version: 0.10 +Version: 0.11 Summary: Command line utility for Linaro validation services Home-page: https://launchpad.net/lava-tool Author: Zygmunt Krynicki diff --git a/lava/tool/__init__.py b/lava/tool/__init__.py index 0f26dab..84551f7 100644 --- a/lava/tool/__init__.py +++ b/lava/tool/__init__.py @@ -24,4 +24,4 @@ lava.tool Generic code for command line utilities for LAVA """ -__version__ = (0, 10, 0, "final", 0) +__version__ = (0, 11, 0, "final", 0) diff --git a/lava_scheduler_tool/commands.py b/lava_scheduler_tool/commands.py index 3529617..367dfda 100644 --- a/lava_scheduler_tool/commands.py +++ b/lava_scheduler_tool/commands.py @@ -19,6 +19,7 @@ import os import sys import argparse +import time import xmlrpclib from lava_tool.authtoken import AuthenticatingServerProxy, KeyringAuthBackend @@ -44,6 +45,9 @@ class submit_job(Command): super(submit_job, cls).register_arguments(parser) parser.add_argument("SERVER") parser.add_argument("JSON_FILE") + parser.add_argument("--block", + action="store_true", + help="Blocks until the job gets executed") def invoke(self): server = AuthenticatingServerProxy( @@ -57,6 +61,23 @@ class submit_job(Command): else: print "submitted as job id:", job_id + if self.args.block: + print('') + print('Waiting for the job to run ') + print('. = job waiting in the queue') + print('# = job running') + print('') + job = {'job_status': 'Unknown'} + progress = {'Submitted': '.', 'Running': '#'} + while job['job_status'] in ['Unknown', 'Submitted', 'Running']: + job = server.scheduler.job_status(job_id) + sys.stdout.write(progress.get(job['job_status'], '')) + sys.stdout.flush() + time.sleep(10) # seconds + print('') + print('') + print('Job Status: %s' % job['job_status']) + class resubmit_job(Command): diff --git a/lava_tool.egg-info/PKG-INFO b/lava_tool.egg-info/PKG-INFO index 91cb643..74a95bb 100644 --- a/lava_tool.egg-info/PKG-INFO +++ b/lava_tool.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: lava-tool -Version: 0.10 +Version: 0.11 Summary: Command line utility for Linaro validation services Home-page: https://launchpad.net/lava-tool Author: Zygmunt Krynicki |