Plugin find target to power on and BMC reset

Change-Id: I04067829af4c10189d1c8cf1e3a1f7f8fe9c5856
Tested: On Master https://openpower.xyz/job/openbmc-build/2006/
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish.py b/lib/bmc_redfish.py
index d0f22a3..eeab824 100644
--- a/lib/bmc_redfish.py
+++ b/lib/bmc_redfish.py
@@ -107,8 +107,7 @@
         args/kwargs      These are passed directly to the corresponding
                          RestClientBase method.
         """
-        self._rest_response_ = self._robj_.post('/redfish/v1/' + resource_path,
-                                                *args, **kwargs)
+        self._rest_response_ = self._robj_.post(resource_path, *args, **kwargs)
         return self._rest_response_
 
     def patch(self, resource_path, *args, **kwargs):
@@ -120,8 +119,7 @@
         args/kwargs      These are passed directly to the corresponding
                          RestClientBase method.
         """
-        self._rest_response_ = self._robj_.patch('/redfish/v1/' + resource_path,
-                                                 *args, **kwargs)
+        self._rest_response_ = self._robj_.patch(resource_path, *args, **kwargs)
         return self._rest_response_
 
     def put(self, resource_path, actions, attr_data):
@@ -133,8 +131,7 @@
         args/kwargs      These are passed directly to the corresponding
                          RestClientBase method.
         """
-        self._rest_response_ = self._robj_.put('/redfish/v1/' + resource_path,
-                                               *args, **kwargs)
+        self._rest_response_ = self._robj_.put(resource_path, *args, **kwargs)
         return self._rest_response_
 
     def delete(self, resource_path):
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index 3b6cb4c..c20139f 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -28,8 +28,9 @@
     # }
 
     redfish.Login
+    ${target}=  redfish_utils.Get Target Actions  /redfish/v1/Systems/system/  ComputerSystem.Reset
     ${payload}=  Create Dictionary  ResetType=${reset_type}
-    ${resp}=  redfish.Post  Systems/system/Actions/ComputerSystem.Reset  body=&{payload}
+    ${resp}=  redfish.Post  ${target}  body=&{payload}
     Should Be Equal As Strings  ${resp.status}  ${HTTP_OK}
     redfish.Logout
 
@@ -47,7 +48,8 @@
     # }
 
     redfish.Login
+    ${target}=  redfish_utils.Get Target Actions  /redfish/v1/Managers/bmc/  Manager.Reset
     ${payload}=  Create Dictionary  ResetType=GracefulRestart
-    ${resp}=  redfish.Post  Managers/bmc/Actions/Manager.Reset  body=&{payload}
+    ${resp}=  redfish.Post  ${target}  body=&{payload}
     Should Be Equal As Strings  ${resp.status}  ${HTTP_OK}
     redfish.Logout