From c141d3c6cf88e6ddf486e42e0bced5042c96dbfd Mon Sep 17 00:00:00 2001 From: Memo Garcia Date: Thu, 14 Apr 2016 11:36:16 +0100 Subject: [PATCH] Remove workaround for web page refresh Closes-bug: 1570292 Change-Id: I78d0aad92f96187e55cec78b76ccf99afb735932 --- disaster_recovery/api/api.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/disaster_recovery/api/api.py b/disaster_recovery/api/api.py index 72040dc..85d9be6 100644 --- a/disaster_recovery/api/api.py +++ b/disaster_recovery/api/api.py @@ -14,7 +14,6 @@ # from horizon. import logging -import time from django.conf import settings @@ -121,13 +120,7 @@ class Job(object): job.get('client_id')) def create(self, job): - job = self._build(job) - # due to elasticsearch replication time, sometimes the newly created - # file is not reflected in the ui immediately, so a quick and dirty - # workaround is to sleep for 3 seconds to make sure that the changes - # are reflected - time.sleep(3) - return job + return self._build(job) def update(self, job_id, job): scheduling = {} @@ -292,13 +285,7 @@ class Session(object): session.get('schedule', {}).get('schedule_end_date')) def create(self, session): - session = self._build(session) - # due to elasticsearch replication time, sometimes the newly created - # file is not reflected in the ui immediately, so a quick and dirty - # workaround is to sleep for 3 seconds to make sure that the changes - # are reflected - time.sleep(3) - return session + return self._build(session) def update(self, session, session_id): return self.client.sessions.update(session_id, session) @@ -387,13 +374,7 @@ class Action(object): action['freezer_action'].get('storage')) def create(self, action): - action = self._build(action) - # due to elasticsearch replication time, sometimes the newly created - # file is not reflected in the ui immediately, so a quick and dirty - # workaround is to sleep for 3 seconds to make sure that the changes - # are reflected - time.sleep(3) - return action + return self._build(action) def update(self, action, action_id): updated_action = {}