Fix to handle Redfish v1.0 session login.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
from redfish import mapping
|
||||||
|
|
||||||
"""
|
"""
|
||||||
STARTING ASSUMPTIONS
|
STARTING ASSUMPTIONS
|
||||||
@@ -285,6 +286,11 @@ class RedfishConnection(object):
|
|||||||
url = self.Root.get_link_url(
|
url = self.Root.get_link_url(
|
||||||
mapping.redfish_mapper.map_sessionservice()
|
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
|
# Craft request body and header
|
||||||
requestBody = {"UserName": self.connection_parameters.user_name , "Password": self.connection_parameters.password}
|
requestBody = {"UserName": self.connection_parameters.user_name , "Password": self.connection_parameters.password}
|
||||||
|
Reference in New Issue
Block a user