Make use of STACK_USER instead of relying on USER
Quite easily one ends up calling ./stack.sh in an environment that,
albeit being user "stack" (for example), doesn't quite meet the
expectations of devstack. The errors that follow can be rather hard to
track down, as the dependency on `USER` is not mentioned.
To remedy this situation, this commit
- uses STACK_USER instead of USER and
- mentions that dependency in the script headers of lib/*
Change-Id: If4cdc39b922ea64b4c0893a0e695ec06349fccc5
diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt
index 6fae0b1..6f90f4a 100644
--- a/lib/nova_plugins/hypervisor-libvirt
+++ b/lib/nova_plugins/hypervisor-libvirt
@@ -7,6 +7,7 @@
# Dependencies:
# ``functions`` file
# ``nova`` configuration
+# ``STACK_USER`` has to be defined
# install_nova_hypervisor - install any external requirements
# configure_nova_hypervisor - make configuration changes, including those to other services
@@ -68,7 +69,7 @@
# with 'unix-group:$group'.
sudo bash -c "cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
[libvirt Management Access]
-Identity=unix-user:$USER
+Identity=unix-user:$STACK_USER
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes