Skip to content

Commit

Permalink
Merge pull request #79 from packethost/fix-dell-version
Browse files Browse the repository at this point in the history
Fix dell version
  • Loading branch information
ofaurax authored Nov 8, 2024
2 parents 9ddf260 + 0307c4b commit ffa3510
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packethardware/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,12 @@ def get_mc_info(prop):
# Dell version encoding
# Their version is A.B.C.D, but we only report A.B.C as D is always 0
# aux: "0x00 0x1e 0x1e 0x00" -> ".30", not ".30.00"
# also "0x00 0x05 0x00 0xab" should be seen as ".00.171" -> ".00"
if normalize_vendor(get_mc_info("vendor")) == "Dell Inc.":
return (
__re_multiline_first(mc_info, regex[prop]).strip()
+ "."
+ str(int(get_mc_info("aux")[5:9], 16))
+ "{:02d}".format(int(get_mc_info("aux")[10:14], 16))
)

# firmware_version provides X.Y, aux 1st byte provides .Z
Expand Down

0 comments on commit ffa3510

Please sign in to comment.