Whamcloud - gitweb
LU-10161 lbuild: fix the problem of determine default_iface 73/30273/2
authorLi Xi <lixi@ddn.com>
Wed, 25 Oct 2017 17:53:37 +0000 (13:53 -0400)
committerJohn L. Hammond <john.hammond@intel.com>
Fri, 2 Feb 2018 17:18:17 +0000 (17:18 +0000)
The script of determining the default interface is broken.
Remove complexity and replace with hostname

Test-Parameters: trivial
Lustre-change: https://review.whamcloud.com/29776
Lustre-commit: bac71754b9dbb83b3ccf10ae99c027cc6b2f9829

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I0d662e9e24bed17078e31b6b5ca305cff2c0548e
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/30273
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
contrib/lbuild/lbuild

index 6b897f7..b09e160 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"