Browse Source

Don't allow virt driver to be configured

configure-hook
James Page 3 years ago
parent
commit
07c9154faa
  1. 8
      snap/bin/launch-libvirtd
  2. 21
      snap/hooks/configure

8
snap/bin/launch-libvirtd

@ -10,9 +10,5 @@ else
ARCH="$SNAP_ARCH-linux-gnu"
fi
driver="$(snapctl get driver)"
if [ "$driver" = "LIBVIRT" ]; then
export LD_LIBRARY_PATH=$SNAP/lib/$ARCH:$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH
exec $SNAP/sbin/libvirtd
fi
export LD_LIBRARY_PATH=$SNAP/lib/$ARCH:$SNAP/usr/lib/$ARCH:$LD_LIBRARY_PATH
exec $SNAP/sbin/libvirtd

21
snap/hooks/configure

@ -1,26 +1,5 @@
#!/bin/bash -e
# Openstack Prep
# which openstack || echo "This snap currently requires the python openstack client to be installed and in your path. The intent is to add the client in before development is complete."; exit 1
# QEMU Setup
echo "qemu setup"
driver="$(snapctl get driver)"
if [[ -n $driver && ! $driver =~ (LIBVIRT|QEMU) ]]; then
echo "\"$driver\" is not a supported virtualization driver"
exit 1
fi
driver_saved="$(cat $SNAP_COMMON/driver)" || true
driver=${driver:-QEMU}
driver_saved=${driver_saved:-QEMU}
if [[ $driver != $driver_saved ]]; then
echo "$driver" > $SNAP_COMMON/driver
snapctl restart $SNAP_NAME
fi
# Install conf.d configuration from snap for db etc
for project in neutron nova keystone glance; do
mkdir -p ${SNAP_COMMON}/etc/${project}/${project}.conf.d

Loading…
Cancel
Save