summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorTaseer Ahmed <taseer94@gmail.com>2017-11-06 10:53:51 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-06 10:53:51 +0000
commitaea749b49ba32fce47b17f98302bfd7053d40668 (patch)
tree8e43405b0e2880bc2d67b9fb220e52adb12de195 /docker
parent4f35267e19cfbfc2d51bc72f4986df5be70950fb (diff)
parent2faf891b5e2a3edf2b9b81866ab9afc89e456e99 (diff)
Merge "Prevent user from starting a second job while one is already running."
Diffstat (limited to 'docker')
-rw-r--r--docker/storperf-master/storperf/storperf_master.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py
index c84a02c..914fc26 100644
--- a/docker/storperf-master/storperf/storperf_master.py
+++ b/docker/storperf-master/storperf/storperf_master.py
@@ -362,6 +362,12 @@ class StorPerfMaster(object):
if (self.stack_id is None):
raise ParameterError("ERROR: Stack does not exist")
+ job_list = self.job_db.fetch_jobs()
+ for job in job_list:
+ report = self.fetch_job_status(job)
+ if report['Status'] == 'Running':
+ raise "ERROR: Job {} is already running".format(job)
+
self._attach_to_openstack()
stack = self._heat_client.stacks.get(self.stack_id)