Revision 3e3ddbf0
b/lib/opcodes.py | ||
---|---|---|
207 | 207 |
ht.TListOf(ht.TAnd(ht.TIsLength(len(_TSetParamsResultItemItems)), |
208 | 208 |
ht.TItems(_TSetParamsResultItemItems))) |
209 | 209 |
|
210 |
# TODO: Generate check from constants.IDISK_PARAMS_TYPES (however, not all users |
|
211 |
# of this check support all parameters) |
|
210 |
# In the disks option we can provide arbitrary parameters too, which |
|
211 |
# we may not be able to validate at this level, so we just check the |
|
212 |
# format of the dict here and the checks concerning IDISK_PARAMS will |
|
213 |
# happen at the LU level |
|
212 | 214 |
_TDiskParams = \ |
213 |
ht.Comment("Disk parameters")(ht.TDictOf(ht.TElemOf(constants.IDISK_PARAMS),
|
|
215 |
ht.Comment("Disk parameters")(ht.TDictOf(ht.TNonEmptyString,
|
|
214 | 216 |
ht.TOr(ht.TNonEmptyString, ht.TInt))) |
215 | 217 |
|
216 | 218 |
_TQueryRow = \ |
b/test/ganeti.rapi.rlib2_unittest.py | ||
---|---|---|
1003 | 1003 |
# Invalid disks and nics |
1004 | 1004 |
for field in ["disks", "nics"]: |
1005 | 1005 |
invalid_values = [None, 1, "", {}, [1, 2, 3], ["hda1", "hda2"], |
1006 |
[{"_unknown_": 999, }]]
|
|
1006 |
[{"_unknown_": False, }]]
|
|
1007 | 1007 |
|
1008 | 1008 |
for invvalue in invalid_values: |
1009 | 1009 |
data = reqfields.copy() |
Also available in: Unified diff