On Fri, Oct 16, 2020 at 09:30:37AM +0800, Zhang Yu wrote:
If ipmitool returns error or empty, the return of "$(ipmitool lan print |grep -E "IP Address\s*:" | awk '{print $4}')" is null, and only add the field
Signed-off-by: Zhang Yu 2134782174@qq.com
tests/host-info | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/host-info b/tests/host-info index a57855dc..6ee8df21 100755 --- a/tests/host-info +++ b/tests/host-info @@ -80,6 +80,11 @@ get_partitions() fi }
+get_ipmi_ip() +{
- echo "ipmi_ip: $(ipmitool lan print |grep -E "IP Address\s*:" | awk '{print $4}')"
+}
main() { get_node @@ -87,6 +92,7 @@ main() get_partitions get_mac get_model_name
- get_ipmi_ip
}
main
2.23.0
Looks good
Thanks, Baijing