mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
11000 add commenting
This commit is contained in:
parent
c07b0f7b9b
commit
fee94ac2a8
@ -220,22 +220,20 @@ class ImportForm(BootstrapMixin, forms.Form):
|
|||||||
records = []
|
records = []
|
||||||
try:
|
try:
|
||||||
for data in yaml.load_all(data, Loader=yaml.SafeLoader):
|
for data in yaml.load_all(data, Loader=yaml.SafeLoader):
|
||||||
"""
|
# checks here are to support both arrays and multiple documents in
|
||||||
checks here are to support both arrays and multiple documents in
|
# yaml data and return as a consistent list for processing (array):
|
||||||
yaml data and return as a consistent list for processing (array):
|
# - address: 10.0.1.0/24
|
||||||
- address: 10.0.1.0/24
|
# status: active
|
||||||
status: active
|
# - address: 10.0.1.1/24
|
||||||
- address: 10.0.1.1/24
|
# status: active
|
||||||
status: active
|
# vs (multi-document):
|
||||||
vs (multi-document):
|
# - address: 10.0.1.0/24
|
||||||
- address: 10.0.1.0/24
|
# status: active
|
||||||
status: active
|
# ---
|
||||||
---
|
# - address: 10.0.1.1/24
|
||||||
- address: 10.0.1.1/24
|
# status: active
|
||||||
status: active
|
# device_type output uses multi-document format, but array format
|
||||||
device_type output uses multi-document format, but array format
|
# is more common output from other tools.
|
||||||
is more common output from other tools.
|
|
||||||
"""
|
|
||||||
if type(data) == list:
|
if type(data) == list:
|
||||||
records.extend(data)
|
records.extend(data)
|
||||||
elif type(data) == dict:
|
elif type(data) == dict:
|
||||||
|
Loading…
Reference in New Issue
Block a user