Browse code

Merge "Make sure to cleanup swift on unstack/relaunch."

Jenkins authored on 2013/01/15 22:59:44
Showing 2 changed files
... ...
@@ -108,16 +108,17 @@ function configure_swift() {
108 108
     if [[ -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
109 109
         if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
110 110
             sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
111
+            sudo rm -f ${SWIFT_DATA_DIR}/drives/images/swift.img
111 112
         fi
112
-    else
113
-        mkdir -p  ${SWIFT_DATA_DIR}/drives/images
114
-        sudo touch  ${SWIFT_DATA_DIR}/drives/images/swift.img
115
-        sudo chown $USER: ${SWIFT_DATA_DIR}/drives/images/swift.img
116
-
117
-        dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
118
-            bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
119 113
     fi
120 114
 
115
+    mkdir -p  ${SWIFT_DATA_DIR}/drives/images
116
+    sudo touch  ${SWIFT_DATA_DIR}/drives/images/swift.img
117
+    sudo chown $USER: ${SWIFT_DATA_DIR}/drives/images/swift.img
118
+
119
+    dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
120
+        bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
121
+
121 122
     # Make a fresh XFS filesystem
122 123
     mkfs.xfs -f -i size=1024  ${SWIFT_DATA_DIR}/drives/images/swift.img
123 124
 
... ...
@@ -65,6 +65,7 @@ fi
65 65
 # Swift runs daemons
66 66
 if is_service_enabled swift; then
67 67
     stop_swift
68
+    cleanup_swift
68 69
 fi
69 70
 
70 71
 # Apache has the WSGI processes