diff --git a/snapcraft/commands/daemon.start b/snapcraft/commands/daemon.start index 8e5b1e638..8f1cc2b28 100755 --- a/snapcraft/commands/daemon.start +++ b/snapcraft/commands/daemon.start @@ -321,27 +321,36 @@ sed \ "${SNAP}/etc/lvm/lvm.conf" > /etc/lvm/lvm.conf # Setup for OVN -echo "==> Cleaning up OVN configuration" -if [ -L /etc/ovn ]; then - echo "=> Removing /etc/ovn symlink" - rm -f /etc/ovn -elif [ -d /etc/ovn ]; then - echo "=> Removing /etc/ovn directory" - rm -rf /etc/ovn -fi - echo "==> Setting up OVN configuration" if [ "${ovn_builtin:-"false"}" = "true" ]; then echo "=> Using builtin OVN" mkdir -p "${SNAP_COMMON}/ovn" ln -s "${SNAP_COMMON}/ovn" /etc/ovn elif [ -d "${SNAP_DATA}/microovn/certificates/pki" ]; then + echo "==> Cleaning up OVN configuration" + if [ -L /etc/ovn ]; then + echo "=> Removing /etc/ovn symlink" + rm -f /etc/ovn + elif [ -d /etc/ovn ]; then + echo "=> Removing /etc/ovn directory" + rm -rf /etc/ovn + fi + echo "=> Detected MicroOVN Content Interface" mkdir -p /etc/ovn ln -s "${SNAP_DATA}/microovn/certificates/pki/client-cert.pem" /etc/ovn/cert_host ln -s "${SNAP_DATA}/microovn/certificates/pki/client-privkey.pem" /etc/ovn/key_host ln -s "${SNAP_DATA}/microovn/certificates/pki/cacert.pem" /etc/ovn/ovn-central.crt elif [ -d /var/snap/microovn/ ]; then + echo "==> Cleaning up OVN configuration" + if [ -L /etc/ovn ]; then + echo "=> Removing /etc/ovn symlink" + rm -f /etc/ovn + elif [ -d /etc/ovn ]; then + echo "=> Removing /etc/ovn directory" + rm -rf /etc/ovn + fi + echo "=> Detected MicroOVN" mkdir -p /etc/ovn ln -s /var/snap/microovn/common/data/pki/client-cert.pem /etc/ovn/cert_host