swmodd: fix DUStateChange event for lxc

This commit is contained in:
suvendhu 2023-11-30 12:58:12 +05:30 committed by Vivek Kumar Dutta
parent 4712d9be73
commit 6fdb0e1e4c

View file

@ -34,7 +34,17 @@ configure_lxc_container() {
if [ -d "${BUNDLE:?}/${name:?}" ]; then if [ -d "${BUNDLE:?}/${name:?}" ]; then
rm -rf "${BUNDLE:?}/${name:?}" rm -rf "${BUNDLE:?}/${name:?}"
fi fi
uci_remove ocicontainer "${section}"
# If directory still exists then uninstall failed
if [ -d "${BUNDLE}/${name}" ]; then
uci_set ocicontainer "${section}" du_status Uninstalling_failed
uci_set ocicontainer "${section}" fault_string "Failed to remove ${BUNDLE}/${name}"
log "LXC container ${name} remove failed"
else
uci_set ocicontainer "${section}" du_status Uninstalling_success
log "LXC container ${name} removed"
fi
return 0; return 0;
fi fi