summaryrefslogtreecommitdiffstats
path: root/api/resources/v2
diff options
context:
space:
mode:
Diffstat (limited to 'api/resources/v2')
-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 8755e5265..8359e105b 100644
--- a/api/resources/v2/images.py
+++ b/api/resources/v2/images.py
@@ -37,6 +37,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 b64f5ef24..885a190c6 100644
--- a/api/resources/v2/tasks.py
+++ b/api/resources/v2/tasks.py
@@ -114,7 +114,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 ca88e9856..b47a8f6b7 100644
--- a/api/resources/v2/testcases.py
+++ b/api/resources/v2/testcases.py
@@ -25,7 +25,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()