Improve Validation and fixed issues based on Issue (#3768)

* Update devicetype.json

* Update moduletype.json

* Update definitions_test.py

* Update device_types.py

* Update devicetype.json

* Update moduletype.json

* Update devicetype.json

* Update HWG-STE.yml

* Update 701BA8PP.yml

* Update WS-C2960C-12PC-L.yaml

* Update snr-ups-onrt-1000-s24-element-ii.yaml

* Update EP-R6.yaml

* Update moduletype.json

* Fixed issues

* Added description limit

---------

Co-authored-by: Harry <harry@cadby.co.uk>
This commit is contained in:
Juniper46
2025-11-27 10:46:51 +00:00
committed by GitHub
parent cd366491a3
commit bed77b1bed
15 changed files with 73 additions and 129 deletions

View File

@@ -113,27 +113,13 @@ interfaces:
module-bays:
- name: PS A
position: A
description: |
170-0310-900 5171, DC PLUGGABLE POWER SUPPLY, -48V
170-0311-900 5171, AC PLUGGABLE POWER SUPPLY, WIDE RANGE 120/240V
description: 170-0310-900 5171 DC or 170-0311-900 5171 AC
- name: PS B
position: B
description: |
170-0310-900 5171, DC PLUGGABLE POWER SUPPLY, -48V
170-0311-900 5171, AC PLUGGABLE POWER SUPPLY, WIDE RANGE 120/240V
description: 170-0310-900 5171 DC or 170-0311-900 5171 AC
- name: Module 1
position: '1'
description: |
Accepts:
* 170-0312-900 2x100G QSFP28 FRU supporting up to 100GbE
* 170-0313-900 2x100G CFP2-DCO FRU supporting up to 100GbE
* 170-0314-900 1x200G CFP2-DCO FRU supporting up to 200GbE
* 170-0315-900 CFP2/QSFP28 combo FRU supporting up to 100GbE
description: 170-0312-900 2x100G QSFP28/170-0313-900 2x100G CFP2-DCO/170-0314-900 1x200G CFP2-DCO/170-0315-900 CFP2/QSFP28
- name: Module 2
position: '2'
description: |
Accepts:
* 170-0312-900 2x100G QSFP28 FRU supporting up to 100GbE
* 170-0313-900 2x100G CFP2-DCO FRU supporting up to 100GbE
* 170-0314-900 1x200G CFP2-DCO FRU supporting up to 200GbE
* 170-0315-900 CFP2/QSFP28 combo FRU supporting up to 100GbE
description: 170-0312-900 2x100G QSFP28/170-0313-900 2x100G CFP2-DCO/170-0314-900 1x200G CFP2-DCO/170-0315-900 CFP2/QSFP28

View File

@@ -19,79 +19,19 @@ module-bays:
description: 186-3010-900 or 186-3011-900
- name: Module 1
position: '1'
description: |
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-900)
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-901)
* Waveserver WL5e 2x800G L-Band Submarine 16xQSFP28/QSFP-DD Module (186-3110-901)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-900)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-901)
* Waveserver WL5e 2x800G L-Band Premium 16xQSFP28/QSFP-DD Module (186-3111-901)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-900)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-901)
* Waveserver WL5e 2x800G L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3112-901)
* Waveserver WL5e 2x800G Encryption C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3160-900)
* Waveserver WL5e 2x800G Encryption C-Band Premium 16xQSFP28/QSFP-DD Module (186-3161-900)
* Waveserver WL5e 2x800G Encryption C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3162-900)
* Waveserver WL5e 2x800G Encryption L-Band Premium 16xQSFP28/QSFP-DD Module (186-3171-900)
* Waveserver WL5e 2x800G Encryption L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3172-900)
description: 186-3100-900/186-3100-901/186-3110-901/186-3101-900/186-3101-901/186-3111-901/186-3102-900/186-3102-901/186-3112-901/186-3160-900/186-3161-900/186-3162-900/186-3171-900/186-3172-900
- name: Module 3
position: '3'
description: |
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-900)
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-901)
* Waveserver WL5e 2x800G L-Band Submarine 16xQSFP28/QSFP-DD Module (186-3110-901)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-900)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-901)
* Waveserver WL5e 2x800G L-Band Premium 16xQSFP28/QSFP-DD Module (186-3111-901)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-900)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-901)
* Waveserver WL5e 2x800G L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3112-901)
* Waveserver WL5e 2x800G Encryption C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3160-900)
* Waveserver WL5e 2x800G Encryption C-Band Premium 16xQSFP28/QSFP-DD Module (186-3161-900)
* Waveserver WL5e 2x800G Encryption C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3162-900)
* Waveserver WL5e 2x800G Encryption L-Band Premium 16xQSFP28/QSFP-DD Module (186-3171-900)
* Waveserver WL5e 2x800G Encryption L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3172-900)
description: 186-3100-900/186-3100-901/186-3110-901/186-3101-900/186-3101-901/186-3111-901/186-3102-900/186-3102-901/186-3112-901/186-3160-900/186-3161-900/186-3162-900/186-3171-900/186-3172-900
- name: Module 5
position: '5'
description: |
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-900)
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-901)
* Waveserver WL5e 2x800G L-Band Submarine 16xQSFP28/QSFP-DD Module (186-3110-901)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-900)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-901)
* Waveserver WL5e 2x800G L-Band Premium 16xQSFP28/QSFP-DD Module (186-3111-901)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-900)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-901)
* Waveserver WL5e 2x800G L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3112-901)
* Waveserver WL5e 2x800G Encryption C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3160-900)
* Waveserver WL5e 2x800G Encryption C-Band Premium 16xQSFP28/QSFP-DD Module (186-3161-900)
* Waveserver WL5e 2x800G Encryption C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3162-900)
* Waveserver WL5e 2x800G Encryption L-Band Premium 16xQSFP28/QSFP-DD Module (186-3171-900)
* Waveserver WL5e 2x800G Encryption L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3172-900)
description: 186-3100-900/186-3100-901/186-3110-901/186-3101-900/186-3101-901/186-3111-901/186-3102-900/186-3102-901/186-3112-901/186-3160-900/186-3161-900/186-3162-900/186-3171-900/186-3172-900
- name: Module 7
position: '7'
description: |
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-900)
* Waveserver WL5e 2x800G C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3100-901)
* Waveserver WL5e 2x800G L-Band Submarine 16xQSFP28/QSFP-DD Module (186-3110-901)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-900)
* Waveserver WL5e 2x800G C-Band Premium 16xQSFP28/QSFP-DD Module (186-3101-901)
* Waveserver WL5e 2x800G L-Band Premium 16xQSFP28/QSFP-DD Module (186-3111-901)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-900)
* Waveserver WL5e 2x800G C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3102-901)
* Waveserver WL5e 2x800G L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3112-901)
* Waveserver WL5e 2x800G Encryption C-Band Submarine 16xQSFP28/QSFP-DD Module (186-3160-900)
* Waveserver WL5e 2x800G Encryption C-Band Premium 16xQSFP28/QSFP-DD Module (186-3161-900)
* Waveserver WL5e 2x800G Encryption C-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3162-900)
* Waveserver WL5e 2x800G Encryption L-Band Premium 16xQSFP28/QSFP-DD Module (186-3171-900)
* Waveserver WL5e 2x800G Encryption L-Band Enhanced 16xQSFP28/QSFP-DD Module (186-3172-900)
description: 186-3100-900/186-3100-901/186-3110-901/186-3101-900/186-3101-901/186-3111-901/186-3102-900/186-3102-901/186-3112-901/186-3160-900/186-3161-900/186-3162-900/186-3171-900/186-3172-900
- name: PSU-1
position: PSU-1
description: |
186-3040-900 AC
186-3041-900 DC
description: 186-3040-900 AC/186-3041-900 DC
- name: PSU-2
position: PSU-2
description: |
186-3040-900 AC
186-3041-900 DC
description: 186-3040-900 AC/186-3041-900 DC

View File

@@ -16,38 +16,16 @@ module-bays:
description: 186-1031-900
- name: Module 1
position: '1'
description: |
* Waveserver Ai 2x400G 56GBaud EDFA L-Band 8xQSFP28 Module (186-1800-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band 8xQSFP28 Module (186-1601-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Standard 8xQSFP28 Module (186-1601-902)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Premium 8xQSFP28 Module (186-1601-901)
* Waveserver Ai 1x400G 35/56GBaud EDFA C-Band 4xQSFP28 Module (186-1603-900)
* Waveserver Ai 2x400G 35/56 GBaud EDFA L-Band 8xQSFP28 Module (186-1801-900)
description: 186-1800-900/186-1601-900/186-1601-902/186-1601-901/186-1603-900/186-1801-900
- name: Module 2
position: '2'
description: |
* Waveserver Ai 2x400G 56GBaud EDFA L-Band 8xQSFP28 Module (186-1800-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band 8xQSFP28 Module (186-1601-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Standard 8xQSFP28 Module (186-1601-902)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Premium 8xQSFP28 Module (186-1601-901)
* Waveserver Ai 1x400G 35/56GBaud EDFA C-Band 4xQSFP28 Module (186-1603-900)
* Waveserver Ai 2x400G 35/56 GBaud EDFA L-Band 8xQSFP28 Module (186-1801-900)
description: 186-1800-900/186-1601-900/186-1601-902/186-1601-901/186-1603-900/186-1801-900
- name: Module 3
position: '3'
description: |
* Waveserver Ai 2x400G 56GBaud EDFA L-Band 8xQSFP28 Module (186-1800-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band 8xQSFP28 Module (186-1601-900)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Standard 8xQSFP28 Module (186-1601-902)
* Waveserver Ai 2x400G 35/56GBaud EDFA C-Band Premium 8xQSFP28 Module (186-1601-901)
* Waveserver Ai 1x400G 35/56GBaud EDFA C-Band 4xQSFP28 Module (186-1603-900)
* Waveserver Ai 2x400G 35/56 GBaud EDFA L-Band 8xQSFP28 Module (186-1801-900)
description: 186-1800-900/186-1601-900/186-1601-902/186-1601-901/186-1603-900/186-1801-900
- name: PSU-1
position: PSU-1
description: |
186-1510-900 AC
186-1511-900 DC
description: 186-1510-900 AC/186-1511-900 DC
- name: PSU-2
position: PSU-2
description: |
186-1510-900 AC
186-1511-900 DC
description: 186-1510-900 AC/186-1511-900 DC

View File

@@ -1,5 +1,5 @@
---
manufacturer: HW-GROUP
manufacturer: HW-Group
model: HWG-STE
slug: hw-group-hwg-ste
airflow: passive

View File

@@ -1,5 +1,5 @@
---
manufacturer: PULTIMO
manufacturer: Pultimo
model: 701BA8PP
slug: pultimo-701ba8pp
part_number: 701BA8PP

View File

@@ -14,8 +14,7 @@ weight_unit: kg
front-ports:
- name: IN RG45 NET SURGE PROTECTION
type: 8p8c
rear_port: '1'
rear_port_position: 1
rear_port: OUT RG45 NET SURGE PROTECTION
rear-ports:
- name: OUT RG45 NET SURGE PROTECTION
type: 8p8c

View File

@@ -26,5 +26,3 @@ interfaces:
type: 1000base-t
- name: eth5
type: 1000base-x-sfp
- name: switch0
type: bridge

View File

@@ -1,3 +1,4 @@
---
manufacturer: Hammond
model: dnrr2377hdwb
slug: hammond-dnrr2377hdwb

View File

@@ -1,3 +1,4 @@
---
manufacturer: Hammond
model: h13045u48bk
slug: hammond-h13045u48bk

View File

@@ -1,3 +1,4 @@
---
manufacturer: Hammond
model: rb-2p77b
slug: hammond-rb-2p77b

View File

@@ -18,7 +18,8 @@
"$ref": "urn:devicetype-library:generated-schema#/definitions/console-port/properties/type"
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
},
"_is_power_source": {
"$ref": "urn:devicetype-library:reusable#/definitions/_is_power_source"
@@ -45,7 +46,8 @@
"$ref": "urn:devicetype-library:generated-schema#/definitions/console-server-port/properties/type"
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -77,7 +79,8 @@
"minimum": 1
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -108,7 +111,8 @@
"$ref": "urn:devicetype-library:generated-schema#/definitions/power-outlet/properties/feed-leg"
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -138,7 +142,8 @@
"type": "boolean"
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
},
"bridge": {
"type": "string",
@@ -187,7 +192,8 @@
"minimum": 1
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -220,7 +226,8 @@
"minimum": 1
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
},
"_is_power_source": {
"$ref": "urn:devicetype-library:reusable#/definitions/_is_power_source"
@@ -248,7 +255,8 @@
"maxLength": 30
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -269,7 +277,8 @@
"maxLength": 64
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [
@@ -297,7 +306,8 @@
"maxLength": 50
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
}
},
"required": [

View File

@@ -110,12 +110,23 @@
}
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
},
"comments": {
"type": "string"
}
},
"allOf": [
{
"if": { "required": ["weight"] },
"then": { "required": ["weight_unit"] }
},
{
"if": { "required": ["weight_unit"] },
"then": { "required": ["weight"] }
}
],
"required": ["manufacturer", "model", "slug", "u_height","is_full_depth"],
"additionalProperties": false
}

View File

@@ -73,12 +73,23 @@
}
},
"description": {
"type": "string"
"type": "string",
"maxLength": 200
},
"comments": {
"type": "string"
}
},
"allOf": [
{
"if": { "required": ["weight"] },
"then": { "required": ["weight_unit"] }
},
{
"if": { "required": ["weight_unit"] },
"then": { "required": ["weight"] }
}
],
"required": ["manufacturer", "model"],
"additionalProperties": false
}

View File

@@ -225,6 +225,7 @@ def test_definitions(file_path, schema, change_type):
if this_device.isDevice:
assert this_device.validate_power(), pytest.fail(this_device.failureMessage, False)
assert this_device.ensure_no_vga(), pytest.fail(this_device.failureMessage, False)
assert this_device.validate_child_u_height(), pytest.fail(this_device.failureMessage, False)
# Check for images if front_image or rear_image is True
if (definition.get('front_image') or definition.get('rear_image')):

View File

@@ -71,7 +71,14 @@ class DeviceType:
# Add the slug to the list of known slugs
KNOWN_SLUGS.add((self.slug, self.file_path))
return True
def validate_child_u_height(self):
subdevice_role = self.definition.get('subdevice_role')
u_height = self.definition.get('u_height', None)
if subdevice_role == "child" and u_height != 0:
self.failureMessage = f'{self.file_path} is a child device but has u_height={u_height}. Must be 0.'
return False
return True
def validate_power(self):
CUSTOM_POWER_SOURCE_PROPERTY = '_is_power_source'