aboutsummaryrefslogtreecommitdiffstats
path: root/api/resources
diff options
context:
space:
mode:
Diffstat (limited to 'api/resources')
-rw-r--r--api/resources/v2/images.py2
-rw-r--r--api/resources/v2/tasks.py3
-rw-r--r--api/resources/v2/testcases.py2
3 files changed, 5 insertions, 2 deletions
diff --git a/api/resources/v2/images.py b/api/resources/v2/images.py
index 701818493..a1577b5d3 100644
--- a/api/resources/v2/images.py
+++ b/api/resources/v2/images.py
@@ -29,6 +29,8 @@ class V2Images(ApiResource):
else:
images = [self.get_info(change_obj_to_dict(i)) for i in images_list]
status = 1 if all(i['status'] == 'ACTIVE' for i in images) else 0
+ if not images:
+ status = 0
return result_handler(consts.API_SUCCESS, {'status': status, 'images': images})
diff --git a/api/resources/v2/tasks.py b/api/resources/v2/tasks.py
index 9790d7640..e95ae0550 100644
--- a/api/resources/v2/tasks.py
+++ b/api/resources/v2/tasks.py
@@ -106,7 +106,8 @@ class V2Task(ApiResource):
if project.tasks:
LOG.info('update tasks in project')
- new_task_list = project.tasks.split(',').remove(task_id)
+ new_task_list = project.tasks.split(',')
+ new_task_list.remove(task_id)
if new_task_list:
new_tasks = ','.join(new_task_list)
else:
diff --git a/api/resources/v2/testcases.py b/api/resources/v2/testcases.py
index 81b4aa88c..8d5b5e398 100644
--- a/api/resources/v2/testcases.py
+++ b/api/resources/v2/testcases.py
@@ -17,7 +17,7 @@ class V2Testcases(ApiResource):
def get(self):
param = Param({})
testcase_list = Testcase().list_all(param)
- return result_handler(consts.API_SUCCESS, testcase_list)
+ return result_handler(consts.API_SUCCESS, {'testcases': testcase_list})
def post(self):
return self._dispatch_post()