Skip to content

Commit bd5dae0

Browse files
committed
Do a proper tls/ca cleanup in unstack
Certificates and the index were left in the data directory after running unstack. That would break devstack on the next run. partial blueprint devstack-https Change-Id: I6eb552a76fb29addf4d02254c027e473d6805df1
1 parent e333796 commit bd5dae0

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

lib/tls

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# - configure_proxy
1919
# - start_tls_proxy
2020

21+
# - stop_tls_proxy
22+
# - cleanup_CA
23+
2124
# - make_root_CA
2225
# - make_int_CA
2326
# - make_cert ca-dir cert-name "common-name" ["alt-name" ...]
@@ -372,6 +375,22 @@ function start_tls_proxy {
372375
}
373376

374377

378+
# Cleanup Functions
379+
# ===============
380+
381+
382+
# Stops all stud processes. This should be done only after all services
383+
# using tls configuration are down.
384+
function stop_tls_proxy {
385+
killall stud
386+
}
387+
388+
389+
# Remove CA along with configuration, as well as the local server certificate
390+
function cleanup_CA {
391+
rm -rf "$DATA_DIR/CA" "$DEVSTACK_CERT"
392+
}
393+
375394
# Tell emacs to use shell-script-mode
376395
## Local variables:
377396
## mode: shell-script

unstack.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ if is_service_enabled horizon; then
122122
stop_horizon
123123
fi
124124

125-
# Kill TLS proxies
125+
# Kill TLS proxies and cleanup certificates
126126
if is_service_enabled tls-proxy; then
127-
killall stud
127+
stop_tls_proxy
128+
cleanup_CA
128129
fi
129130

130131
SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/*

0 commit comments

Comments
 (0)