[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH appliance] Handle errors for contacting host for local VM management better



Old rc.local snipped could possibly error out and cause cobbler setup to fail.
This revised section always makes this section of code successful even if
the local host is not setup as an ovirt-node.

Signed-off-by: Perry Myers <pmyers redhat com>
---
 ovirt-appliance.ks |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/ovirt-appliance.ks b/ovirt-appliance.ks
index 3de32fb..ebaaba2 100644
--- a/ovirt-appliance.ks
+++ b/ovirt-appliance.ks
@@ -41,10 +41,8 @@ lokkit
   cat >> /etc/rc.d/rc.local << \EOF
 # Try to contact the host we are running on; if we succeed, we'll use it as
 # one of the managed nodes; if not, no big deal
-exec 3<> /dev/tcp/192.168.50.1/7777
-echo "AWAKE" 1>&3
-exec 3<> /dev/tcp/192.168.50.1/7777
-echo "IDENTIFY" 1>&3
+(exec 3<> /dev/tcp/192.168.50.1/7777 && echo "AWAKE" 1>&3 \
+      && exec 3<> /dev/tcp/192.168.50.1/7777 && echo "IDENTIFY" 1>&3) || :
 EOF
 
   # make sure to update the /etc/hosts with the list of all possible DHCP
-- 
1.5.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]