Skip to content

Commit 4bae36d

Browse files
authored
Merge pull request #513 from cdtomkins/ctomkins_fix_procurve_oobm_ip
Fixed HP ProCurve not onboarding if using OOBM interface
1 parent 794d1ca commit 4bae36d

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

changes/513.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed HP ProCurve not onboarding if using OOBM interface.

nautobot_device_onboarding/command_mappers/hp_procurve.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
sync_devices:
3+
pre_processor:
4+
oobm_data:
5+
commands:
6+
- command: "show oobm ip"
7+
parser: "textfsm"
8+
jpath: "[?member=='Global']"
9+
post_processor: "{{ obj[0] | tojson if obj else {} | tojson }}"
310
hostname:
411
commands:
512
- command: "show system"
@@ -20,12 +27,14 @@ sync_devices:
2027
- command: "show ip"
2128
parser: "textfsm"
2229
jpath: "[?contains(ip_address, `{{ obj }}`)].intf_name"
30+
post_processor: "{% if obj %}{{ obj[0] }}{% else %}{{ 'oobm' }}{% endif %}"
31+
iterable_type: "str"
2332
mask_length:
2433
commands:
2534
- command: "show ip"
2635
parser: "textfsm"
2736
jpath: "[?contains(ip_address, `{{ obj }}`)].ip_mask"
28-
post_processor: "{{ obj[0] | netmask_to_cidr }}"
37+
post_processor: "{% if obj %}{{ obj[0] | netmask_to_cidr }}{% else %}{{ oobm_data['prefix_length'] }}{% endif %}"
2938
iterable_type: "int"
3039
sync_network_data:
3140
pre_processor:

nautobot_device_onboarding/tests/mock/hp_procurve/command_getter_result_1.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,5 +925,6 @@
925925
"capabilities": "other, bridge",
926926
"mgmt_address": ""
927927
}
928-
]
929-
}
928+
],
929+
"show oobm ip": []
930+
}

0 commit comments

Comments
 (0)