Whamcloud - gitweb
LU-10161 lbuild: fix the problem of determine default_iface 76/29776/4
authorLi Xi <lixi@ddn.com>
Wed, 25 Oct 2017 17:53:37 +0000 (13:53 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 22 Nov 2017 03:55:58 +0000 (03:55 +0000)
The script of determining the default interface is broken.
Remove complexity and replace with hostname

Test-Parameters: trivial
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I0d662e9e24bed17078e31b6b5ca305cff2c0548e
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/29776
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
contrib/lbuild/lbuild

index 86b08c7..e05dcb9 100755 (executable)
@@ -1342,13 +1342,9 @@ store_for_reuse() {
         linkflag="l"
     fi
 
-    local default_iface=$(/sbin/ip route get 192.1.1.1 | sed -ne 's/.* dev \(.*\)  * src .*/\1/p')
-    if [ -z "$default_iface" ]; then
-        fatal 1 "Failed to determine the default route interface"
-    fi
-    local unique_id=$(/sbin/ip addr show dev $default_iface | sed -ne '/ inet /s/ *inet \(.*\)\/.*/\1/p' | head -1)
+    local unique_id=$(hostname -s)
     if [ -z "$unique_id" ]; then
-        fatal 1 "Failed to determine a unique id from interface $default_interface"
+        fatal 1 "Failed to determine hostname."
     fi
 
     local finallocation="$location"/"$signature"/"$module"