Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
nexbox
NetBox Backend Scripts
Commits
572f35b9
Unverified
Commit
572f35b9
authored
Feb 18, 2021
by
Adrian Schollmeyer
Browse files
hausaufgang, patch: Update script parameters
Signed-off-by:
NexAdn
<
nex@nexadn.de
>
parent
db925223
Changes
2
Hide whitespace changes
Inline
Side-by-side
hausaufgang.py
View file @
572f35b9
...
...
@@ -88,24 +88,6 @@ class ConnectUserports(Script):
name
=
"(disabled) Connect userport to patchpanels"
description
=
"Bulk connect userports to a patchpanel"
patchpanel
=
ObjectVar
(
label
=
"Patchpanel"
,
queryset
=
Device
.
objects
.
filter
(
device_role__name
=
"Patchpanel Kupfer"
)
)
aufgang
=
ObjectVar
(
label
=
"Hausaufgang"
,
queryset
=
Device
.
objects
.
filter
(
device_role__name
=
"Hausaufgang"
)
)
connections
=
TextVar
(
label
=
"Connections"
,
description
=
"One connection per line. Form: [Userport name] | [Hausaufgang name]"
)
def
run
(
self
,
data
,
commit
):
self
.
log_error
(
"I currently do nothing!"
)
pass
patch.py
View file @
572f35b9
...
...
@@ -76,19 +76,6 @@ class BulkPatch(Script):
label
=
"Device B"
,
queryset
=
Device
.
objects
)
port_a_use_interfaces
=
BooleanVar
(
label
=
"Use interfaces on device A"
,
description
=
"true = use interfaces, false = use Front Ports (sorry"
" for bad UX, ChoiceVar seems to be broken)"
)
port_b_use_interfaces
=
BooleanVar
(
label
=
"Use interfaces on device B"
)
patch_pairs
=
TextVar
(
label
=
"Patch pairs"
,
description
=
"Syntax: [A-Port] | [B-Port]. Each patch pair on its own"
" line."
)
port_type_a
=
ChoiceVar
(
label
=
"Device A port type"
,
choices
=
PORT_TYPES
...
...
@@ -97,6 +84,11 @@ class BulkPatch(Script):
label
=
"Device B port type"
,
choices
=
PORT_TYPES
)
patch_pairs
=
TextVar
(
label
=
"Patch pairs"
,
description
=
"Syntax: [A-Port] | [B-Port]. Each patch pair on its own"
" line."
)
cable_label
=
StringVar
(
label
=
"Cable label"
,
required
=
False
,
...
...
@@ -110,14 +102,13 @@ class BulkPatch(Script):
def
run
(
self
,
data
,
commit
):
dev_a
=
data
[
"dev_a"
]
dev_b
=
data
[
"dev_b"
]
port_a_use_interfaces
=
data
[
"port_a_use_interfaces"
]
port_b_use_interfaces
=
data
[
"port_b_use_interfaces"
]
patch_pairs
=
data
[
"patch_pairs"
]
cable_label
=
data
[
"cable_label"
]
port_a_type
=
data
[
"port_type_a"
]
port_b_type
=
data
[
"port_type_b"
]
patch_pairs
=
data
[
"patch_pairs"
]
cable_label
=
data
[
"cable_label"
]
create_patches
=
True
patch_pair_no
=
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment