Fix test_list_with_limit failed

There is no action plan if creating audit was cancelled.
In this case, we just return none.

Change-Id: Ia7a93dab5978d181557d7dd7499e83655aec6f40
Closes-Bug: #1700901
This commit is contained in:
licanwei 2017-06-28 14:40:46 +08:00
parent 8fc9c6c1d8
commit 87b95bb639
1 changed files with 2 additions and 0 deletions

View File

@ -232,6 +232,8 @@ class BaseInfraOptimTest(test.BaseTestCase):
)
_, action_plans = cls.client.list_action_plans(audit_uuid=audit_uuid)
if len(action_plans['action_plans']) == 0:
return
return action_plans['action_plans'][0]