diff options
author | Taseer Ahmed <taseer94@gmail.com> | 2017-10-09 00:45:10 +0500 |
---|---|---|
committer | Taseer Ahmed <taseer94@gmail.com> | 2017-10-09 10:50:05 +0500 |
commit | 2faf891b5e2a3edf2b9b81866ab9afc89e456e99 (patch) | |
tree | 59f3de2366e0d246c99902ed695a955db305a94d /docker | |
parent | d45e5a980fc4f75f0f9abed929705da32e9f2fcf (diff) |
Prevent user from starting a second job while one is already running.
JIRA: STORPERF-214
Change-Id: I1fe7c0bc61dfa7899d39cee1d13f99b2435115cd
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/storperf-master/storperf/storperf_master.py | 6 |
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 ef9ace3..983def6 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) |