def get_ilo_firmware_version_as_major_minor(self): """Gets the ilo firmware version for server capabilities Parse the get_host_health_data() to retreive the firmware details. :param data: the output returned by get_host_health_data() :returns: String with the format "<major>.<minor>" or None. """ data = self.get_host_health_data() firmware_details = self._get_firmware_embedded_health(data) if firmware_details: ilo_version_str = firmware_details.get('iLO', None) return common.get_major_minor(ilo_version_str)
def test_get_major_minor_unexpected(self): ver_str = "iLO 4 v" actual = None expected = common.get_major_minor(ver_str) self.assertEqual(actual, expected)
def test_get_major_minor_gt_suggested_min(self): ver_str = "iLO 4 v2.5" actual = "2.5" expected = common.get_major_minor(ver_str) self.assertEqual(actual, expected)