#!/bin/bash
set -eux

# TODO: bail out early if the config is not using the virtual power driver.
#
# This key is to be retrieved to allow nova to ssh
# into the host machine when using VirtualPowerManager
KEYPATH=/opt/stack/boot-stack/virtual-power-key
if [ ! -e $KEYPATH ] ; then
    ssh-keygen -t rsa -f $KEYPATH \
        -N '' -C 'boot-stack key for use with nova VirtualPowerDriver'
fi
chown nova:nova ${KEYPATH}*
chmod 400 ${KEYPATH}*
chmod a+r ${KEYPATH}.pub

