summaryrefslogtreecommitdiffstats
path: root/api/resources/v2/images.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/resources/v2/images.py')
-rw-r--r--api/resources/v2/images.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/resources/v2/images.py b/api/resources/v2/images.py
index 701818493..8359e105b 100644
--- a/api/resources/v2/images.py
+++ b/api/resources/v2/images.py
@@ -1,3 +1,11 @@
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
import logging
import subprocess
import threading
@@ -29,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})