Merge "Add yamllint verification of compass4nfv"
authorJun Li <matthew.lijun@huawei.com>
Thu, 29 Dec 2016 02:30:37 +0000 (02:30 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 29 Dec 2016 02:30:38 +0000 (02:30 +0000)
jjb/dovetail/dovetail-cleanup.sh
utils/test/testapi/opnfv_testapi/resources/models.py
utils/test/testapi/opnfv_testapi/resources/result_models.py

index f215278..22b2ba2 100755 (executable)
@@ -2,14 +2,35 @@
 
 [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
 
-echo "Cleaning up docker containers/images..."
-# Remove previous running containers if exist
+#clean up dependent project docker images, which has no containers and image tag None
+clean_images=(opnfv/functest opnfv/yardstick)
+for clean_image in "${clean_images[@]}"; do
+    echo "Removing image $image_id, which has no containers and image tag is None"
+    dangling_images=($(docker images -f "dangling=true" | grep ${clean_image} | awk '{print $3}'))
+    if [[ -n ${dangling_images} ]]; then
+        for image_id in "${dangling_images[@]}"; do
+            docker rmi $image_id >${redirect}
+        done
+    fi
+done
+
+echo "Remove containers with image dovetail:<None>..."
+dangling_images=($(docker images -f "dangling=true" | grep opnfv/dovetail | awk '{print $3}'))
+if [[ -n ${dangling_images} ]]; then
+    for image_id in "${dangling_images[@]}"; do
+        echo "Removing image $image_id with tag None and its related containers"
+        docker ps -a | grep $image_id | awk '{print $1}'| xargs docker rm -f >${redirect}
+        docker rmi $image_id >${redirect}
+    done
+fi
+
+echo "Cleaning up dovetail docker containers/images..."
 if [[ ! -z $(docker ps -a | grep opnfv/dovetail) ]]; then
     echo "Removing existing opnfv/dovetail containers..."
     docker ps -a | grep opnfv/dovetail | awk '{print $1}' | xargs docker rm -f >${redirect}
 fi
 
-# Remove existing images if exist
+echo "Remove dovetail existing images if exist..."
 if [[ ! -z $(docker images | grep opnfv/dovetail) ]]; then
     echo "Docker images to remove:"
     docker images | head -1 && docker images | grep opnfv/dovetail >${redirect}
index a281c66..f518c97 100644 (file)
@@ -70,6 +70,7 @@ class ModelBase(object):
         return t\r
 \r
 \r
+@swagger.model()\r
 class CreateResponse(ModelBase):\r
     def __init__(self, href=''):\r
         self.href = href\r
index 3011902..50445fc 100644 (file)
@@ -112,7 +112,7 @@ class TestResult(models.ModelBase):
 @swagger.model()
 class TestResults(models.ModelBase):
     """
-        @property rgit esults:
+        @property results:
         @ptype results: C{list} of L{TestResult}
     """
     def __init__(self):