summaryrefslogtreecommitdiff
path: root/devstack/tools/ironic/scripts
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-02-19 19:51:30 +0100
committerIlya Etingof <etingof@gmail.com>2019-03-20 18:49:17 +0100
commit62d40c17e55901e80009c8f78f38f37abc6f665d (patch)
tree5d349931fb7893e73f1cae4fee8fcfbedd713ff1 /devstack/tools/ironic/scripts
parent1027dbab51a9b77ccde376656202e6998499a29b (diff)
downloadironic-62d40c17e55901e80009c8f78f38f37abc6f665d.tar.gz
Add systemd unit for vbmcd in devstack
Besides managing vbmcd from systemd, this patch fixes a bug in vbmcd handling. The bug was that devstack runs ironic plugin under user `stack`, but preserving superuser environment by means of `su -p`. That makes `vbmcd` expanding tilda into `/root`, attempting to write into that directory and failing miserably. On top of that, all this happens when `vbmc` tries to invoke `vbmcd` under the hood to preserve backward compatibility of the `vbmc` behaviour before `vbmcd` was introduced. This patch: * adds systemd unit file for vbmcd * invokes `vbmcd` explicitly before everything else and * does that before becoming root and `stack` again The `vbmc` tool can still run in a broken environment for as long as it does not depend on the config file. Change-Id: I6670ea50d126065d0472e558943890d4f9313083
Diffstat (limited to 'devstack/tools/ironic/scripts')
-rwxr-xr-xdevstack/tools/ironic/scripts/cleanup-node.sh2
-rwxr-xr-xdevstack/tools/ironic/scripts/create-node.sh6
2 files changed, 4 insertions, 4 deletions
diff --git a/devstack/tools/ironic/scripts/cleanup-node.sh b/devstack/tools/ironic/scripts/cleanup-node.sh
index e594c282b..466b7059b 100755
--- a/devstack/tools/ironic/scripts/cleanup-node.sh
+++ b/devstack/tools/ironic/scripts/cleanup-node.sh
@@ -23,7 +23,7 @@ virsh list --inactive | grep -q $NAME && virsh undefine $NAME --nvram
# Delete the Virtual BMC
if [[ $(type -P vbmc) != "" ]]; then
- sudo vbmc list | grep -a $NAME && sudo vbmc delete $NAME
+ vbmc list | grep -a $NAME && vbmc delete $NAME
fi
if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then
diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh
index a26452282..077d21246 100755
--- a/devstack/tools/ironic/scripts/create-node.sh
+++ b/devstack/tools/ironic/scripts/create-node.sh
@@ -129,10 +129,10 @@ if ! virsh list --all | grep -q $NAME; then
--disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \
--interface-count $INTERFACE_COUNT $MAC_ADDRESS >&2
- # Createa Virtual BMC for the node if IPMI is used
+ # Create Virtual BMC for the node if IPMI is used
if [[ $(type -P vbmc) != "" ]]; then
- sudo vbmc add $NAME --port $VBMC_PORT
- sudo vbmc start $NAME
+ vbmc add $NAME --port $VBMC_PORT
+ vbmc start $NAME
fi
fi