Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netvs-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
netvs-middleware
Commits
dd35a2c1
Commit
dd35a2c1
authored
10 months ago
by
!! Julian Keck (old Account; do not use) !!
Browse files
Options
Downloads
Patches
Plain Diff
UPD show vlan-ids in patch-request email
parent
fca03829
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/patch_request.py
+8
-0
8 additions, 0 deletions
api/patch_request.py
model/patch_request.py
+1
-0
1 addition, 0 deletions
model/patch_request.py
templates/patch_request_template.j2
+5
-0
5 additions, 0 deletions
templates/patch_request_template.j2
with
14 additions
and
0 deletions
api/patch_request.py
+
8
−
0
View file @
dd35a2c1
...
...
@@ -233,8 +233,16 @@ def validate_patch_request_actions(conn, user, actions: list[APIPatchRequestActi
)
bcd_result
=
execute_wapi_function
(
conn
,
[
{
'
idx
'
:
'
bcd_list
'
,
'
name
'
:
'
nd.bcd.list
'
,
'
old
'
:
{
'
name
'
:
action
.
bcd_name
}},
{
'
idx
'
:
'
vlan_list
'
,
'
name
'
:
'
nd.vlan.list
'
,
'
inner_join_ref
'
:
{
'
bcd_list
'
:
'
default
'
}},
],
user
=
user
.
login_name
)
internal_action
.
bcd
=
Port
(
**
bcd_result
[
'
bcd_list
'
][
0
])
if
len
(
bcd_result
[
'
vlan_list
'
])
>
0
:
internal_action
.
vlan_ids
=
list
(
map
(
lambda
v
:
'
{compound}: {id}
'
.
format
(
compound
=
v
.
get
(
'
net_instnc
'
,
'
UNKNOWN?
'
),
id
=
v
[
'
id
'
]),
bcd_result
[
'
vlan_list
'
]))
else
:
internal_action
.
vlan_ids
=
[
'
VLAN does not exist in any compound.
'
]
elif
action
.
action
==
PatchActionType
.
PATCH
:
raise
HTTPException
(
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
...
...
This diff is collapsed.
Click to expand it.
model/patch_request.py
+
1
−
0
View file @
dd35a2c1
...
...
@@ -45,6 +45,7 @@ class PatchRequestAction(BaseModel):
ports_summary
:
Optional
[
str
]
=
Field
(
default
=
None
)
new_insert_type
:
Optional
[
str
]
=
Field
(
default
=
None
)
new_insert_assignment
:
list
[
APIInsertBCDAssignment
]
=
Field
(
default
=
[])
vlan_ids
:
list
[
str
]
=
Field
(
default
=
[])
class
PatchRequestFormRequest
(
BaseModel
):
...
...
This diff is collapsed.
Click to expand it.
templates/patch_request_template.j2
+
5
−
0
View file @
dd35a2c1
...
...
@@ -18,6 +18,11 @@
{% endif %}
{% if action['bcd'] is defined and action['bcd']['name'] is defined %}
<b>Broadcast domain:</b> {{ action['bcd']['name'] }} ({% if action['bcd_tagged'] %}add tagged{%else%}untagged{%endif%})<br>
<ul>
{% for v in action['vlan_ids'] %}
<li>{{ v }}</li>
{% endfor %}
</ul>
{% endif %}
{% if action['new_insert_type'] %}
<b>New insert:</b> {{ action['new_insert_type'] }}<br>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment