From a3755a10712b30a2dca8a0d230de109d840f2e6e Mon Sep 17 00:00:00 2001 From: Uggla Date: Wed, 23 Sep 2015 23:52:11 +0200 Subject: [PATCH] Fix to handle Redfish v1.0 session login. --- redfish/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/redfish/main.py b/redfish/main.py index 5736732..4f93db6 100644 --- a/redfish/main.py +++ b/redfish/main.py @@ -11,6 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +from redfish import mapping """ STARTING ASSUMPTIONS @@ -285,6 +286,11 @@ class RedfishConnection(object): url = self.Root.get_link_url( mapping.redfish_mapper.map_sessionservice() ) + + # Handle login with redfish 1.00, url must be : + # /rest/v1/SessionService/Sessions as specified by the specification + if float(mapping.redfish_version) >= 1.00: + url += '/Sessions' # Craft request body and header requestBody = {"UserName": self.connection_parameters.user_name , "Password": self.connection_parameters.password}