Fix for default gateway issue
Signed-off-by: Prashanth Katti <prkatti1@in.ibm.com>
Change-Id: I15d2110b4acd087d37ba616f32c852febdadc2b6
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 3c5592e..b4c6c79 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -522,3 +522,16 @@
... Should Be Equal ${status} ${True}
... msg=Configuration of valid IP Failed.
+
+Get BMC Default Gateway
+ [Documentation] Get system default gateway.
+
+ ${route_info}= Get BMC Route Info
+
+ ${lines}= Get Lines Containing String ${route_info} default via
+ @{gateway_list}= Split To Lines ${lines}
+
+ # Extract first default gateway and return.
+ @{default_gw}= Split String ${gateway_list[0]}
+
+ [Return] ${default_gw[2]}