Task status 'pending' handled in tests

Status 'pending' introduced for proper tasks as intermediate status
for tasks ready for sending or already sent to astute, but not
acknoledged by astute. After task is acknoledged by astute it
changes status to 'running'.

Change-Id: Idedb061b7b5c4dca4a0ca7adcaa570cecbb691af
Partial-Bug: #1498827
This commit is contained in:
Alexander Kislitsky 2015-10-28 19:03:36 +03:00
parent 49115b87c3
commit 8e8f21fed9
2 changed files with 8 additions and 7 deletions

View File

@ -1023,8 +1023,8 @@ class FuelWebClient(object):
start = time.time()
try:
wait(
lambda: self.client.get_task(
task['id'])['status'] != 'running',
lambda: (self.client.get_task(task['id'])['status']
not in ('pending', 'running')),
interval=interval,
timeout=timeout
)
@ -2246,9 +2246,10 @@ class FuelWebClient(object):
cluster_id=cluster_id, data=tasks,
node_id=','.join(map(str, nodes)))
tasks = self.client.get_tasks()
deploy_tasks = [t for t in tasks if t['status'] == 'running'
and t['name'] == 'deployment'
and t['cluster'] == cluster_id]
deploy_tasks = [t for t in tasks if t['status']
in ('pending', 'running') and
t['name'] == 'deployment' and
t['cluster'] == cluster_id]
for task in deploy_tasks:
if min([t['progress'] for t in deploy_tasks]) == task['progress']:
return task

View File

@ -66,8 +66,8 @@ class CommandLine(TestBasic):
start = time.time()
try:
wait(
lambda: self.get_task(
remote, task['id'])['status'] != 'running',
lambda: (self.get_task(remote, task['id'])['status'] not in
('pending', 'running')),
interval=interval,
timeout=timeout
)