]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
windows: Check for cephadm binary before attempting to use it 2051/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 9 Aug 2022 15:44:44 +0000 (11:44 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 9 Aug 2022 15:44:44 +0000 (11:44 -0400)
Fixes:
```
+ [[ -x /home/jenkins-build/build/workspace/wnbd-build/cephadm ]]
+ sudo /home/jenkins-build/build/workspace/wnbd-build/cephadm rm-repo
[sudo] password for jenkins-build:
sudo: no password was provided
sudo: a password is required
Build step 'Execute scripts' changed build result to FAILURE
Build step 'Execute scripts' marked build as failure
```

Signed-off-by: David Galloway <dgallowa@redhat.com>
scripts/ceph-windows/cleanup

index 215337a6a986b93d96657c21e6ad6ff88312446a..eae1e78cdb9c163747f7a65d46fe11acefc1b9ce 100644 (file)
@@ -8,15 +8,17 @@ delete_libvirt_vms
 clear_libvirt_networks
 
 # Cleanup Ceph clusters spawned via cephadm
-if [[ -x $WORKSPACE/cephadm ]] && [[ -d /var/lib/ceph ]]; then
-    for FSID in $(sudo ls /var/lib/ceph); do
-        echo "Removing Ceph cluster $FSID"
-        sudo $WORKSPACE/cephadm rm-cluster --fsid $FSID --force
-    done
+if [[ -x $WORKSPACE/cephadm ]]; then
+    sudo $WORKSPACE/cephadm rm-repo
+    if [[ -d /var/lib/ceph ]]; then
+        for FSID in $(sudo ls /var/lib/ceph); do
+            echo "Removing Ceph cluster $FSID"
+            sudo $WORKSPACE/cephadm rm-cluster --fsid $FSID --force
+        done
+    fi
 fi
 
-# Cleanup remaning files / directories
-sudo $WORKSPACE/cephadm rm-repo
+# Cleanup remaining files / directories
 sudo rm -rf \
     $WORKSPACE/ceph.conf $WORKSPACE/keyring $WORKSPACE/cephadm \
     $WORKSPACE/ceph.zip $WORKSPACE/known_hosts \