]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Getting Started: Fix IP address determination on F17
authorZane Bitter <zbitter@redhat.com>
Mon, 15 Oct 2012 09:57:11 +0000 (11:57 +0200)
committerZane Bitter <zbitter@redhat.com>
Mon, 15 Oct 2012 09:58:15 +0000 (11:58 +0200)
The format of the output of ifconfig has changed between Fedora 16 and
Fedora 17, so starting the metadata server failed on the latter due to a
missing IP address.

The change makes the script work with either format, and also now fails
with an error if it breaks again.

Change-Id: I7012af7bd7c15f6a962d19e66c8a0d8401243895
Signed-off-by: Zane Bitter <zbitter@redhat.com>
docs/GettingStarted.rst

index 461b100315c17b712c975c4743f650564a027f4f..f3870bf530dcde1ed534a227e8d5f0b33cd17032 100644 (file)
@@ -305,8 +305,8 @@ Configure the Metadata server
 
 Some templates require the ``heat-metadata`` server also. The metadata server must be configured to bind to the IP address of the host machine on the Nova network created above (``demonetbr0``). This allows the launched instances to access the metadata server. However, the bridge interface is not actually created until an instance is launched in Nova. If you have completed the preceding steps the bridge will now have been created, so you can proceed to edit the file ``/etc/heat/heat-metadata.conf`` to change the ``bind_host`` value from the default ``0.0.0.0`` to the correct IP address and launch the metadata server::
 
-    BIND_IP=`ifconfig demonetbr0 | sed -e 's/ *inet addr:\([0-9.]\+\).*/\1/' -e t -e d`
-    sudo sed -i -e "/^bind_host *=/ s/0\.0\.0\.0/${BIND_IP}/" /etc/heat/heat-metadata.conf
+    BIND_IP=`ifconfig demonetbr0 | sed -e 's/ *inet \(addr:\)\?\([0-9.]\+\).*/\2/' -e t -e d`
+    sudo sed -i -e "/^bind_host *=/ s/0\.0\.0\.0/${BIND_IP:?}/" /etc/heat/heat-metadata.conf
     
     sudo -E bash -c 'heat-metadata &'