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

Proposed by Paride Legovini
Status: Merged
Approved by: Paride Legovini
Approved revision: a375dd80bacf90caee50b360cf4e0d63d12be9fa
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~paride/curtin:fix-dasd-device_id-range
Merge into: curtin:master
Diff against target: 15 lines (+2/-2)
1 file modified
curtin/block/dasd.py (+2/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
curtin developers Pending
Review via email: mp+389594@code.launchpad.net

Commit message

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

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

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

The code change is correct, the Commit message above is not, we accept 0 -> 0xffff (inclusive)

The < 65535 failed for value of 0xffff (65535).

review: Needs Fixing
Revision history for this message
Ryan Harper (raharper) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/dasd.py b/curtin/block/dasd.py
2index 682f9d3..b7008f6 100644
3--- a/curtin/block/dasd.py
4+++ b/curtin/block/dasd.py
5@@ -269,9 +269,9 @@ def _valid_device_id(device_id):
6 if not (0 <= int(dsn, 16) < 256):
7 raise ValueError("device_id invalid: dsn not in 0-255: '%s'" % dsn)
8
9- if not (0 <= int(dev.lower(), 16) < 65535):
10+ if not (0 <= int(dev.lower(), 16) <= 65535):
11 raise ValueError(
12- "device_id invalid: devno not in 0-0x10000: '%s'" % dev)
13+ "device_id invalid: devno not in 0-0xffff: '%s'" % dev)
14
15 return True
16

Subscribers

People subscribed via source and target branches