← Back to team overview

curtin-dev team mailing list archive

[Merge] ~paride/curtin:fix-dasd-device_id-range into curtin:master

 

Paride Legovini has proposed merging ~paride/curtin:fix-dasd-device_id-range into curtin:master.

Commit message:
dasd: fix off-by-one device_id devno range check

devno can be in the 0-0x10000 range, inclusive.

Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~paride/curtin/+git/curtin/+merge/389594
-- 
Your team curtin developers is requested to review the proposed merge of ~paride/curtin:fix-dasd-device_id-range into curtin:master.
diff --git a/curtin/block/dasd.py b/curtin/block/dasd.py
index 682f9d3..0307bcc 100644
--- a/curtin/block/dasd.py
+++ b/curtin/block/dasd.py
@@ -269,7 +269,7 @@ def _valid_device_id(device_id):
     if not (0 <= int(dsn, 16) < 256):
         raise ValueError("device_id invalid: dsn not in 0-255: '%s'" % dsn)
 
-    if not (0 <= int(dev.lower(), 16) < 65535):
+    if not (0 <= int(dev.lower(), 16) <= 65535):
         raise ValueError(
             "device_id invalid: devno not in 0-0x10000: '%s'" % dev)
 

Follow ups