module IDRAC::License
def license_version
-
(Integer, nil)
- The license version (e.g. 9) or nil if not found
def license_version license = license_info return nil unless license # Check the Description field, which often contains the version # Example: "iDRAC9 Enterprise License" if license.Description && license.Description.match(/iDRAC(\d+)/i) version = license.Description.match(/iDRAC(\d+)/i)[1].to_i debug "Found license version from Description: #{version}", 1 return version end # Try alternative fields if Description didn't work if license.Name && license.Name.match(/iDRAC(\d+)/i) version = license.Name.match(/iDRAC(\d+)/i)[1].to_i debug "Found license version from Name: #{version}", 1 return version end debug "Could not determine license version from license info", 1, :yellow nil end