fix a devstack plugin bug

devstack default user stack may not have permission to modify system
file /etc/hosts. use sudo to make sure the modification is done.

Change-Id: Iabe47cae88da9d70a1f7788c1847d99856963713
Closes-Bug: 1816520
Signed-off-by: Yi Wang <yi.c.wang@intel.com>
changes/08/637708/1 final-non-containers-green
Yi Wang 4 years ago
parent 506ef3fd7f
commit ab3f2385e8
  1. 4
      devstack/lib/stx-metal

@ -463,11 +463,11 @@ function configure_maintenance {
# TODO: enable controllerconfig to do this
# add floating ip hostname in hosts
if ! cat /etc/hosts | grep controller$ > /dev/null; then
sudo echo "192.168.204.2 controller" >> /etc/hosts
echo "192.168.204.2 controller" | sudo tee -a /etc/hosts
fi
# add controller-0
if ! cat /etc/hosts | grep [0-9]$'\s'controller-0$ > /dev/null; then
sudo echo "192.168.204.3 controller-0" >> /etc/hosts
echo "192.168.204.3 controller-0" | sudo tee -a /etc/hosts
fi
# puppet configuration for mtce

Loading…
Cancel
Save