Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
c01e452b
Commit
c01e452b
authored
4 months ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Fix pydantic error in defining NoneType read-only fields.
parent
c421c534
Branches
main
No related tags found
1 merge request
!307
Feature/l2circuits
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/l2_circuit/create_layer_2_circuit.py
+12
-14
12 additions, 14 deletions
gso/workflows/l2_circuit/create_layer_2_circuit.py
with
12 additions
and
14 deletions
gso/workflows/l2_circuit/create_layer_2_circuit.py
+
12
−
14
View file @
c01e452b
...
@@ -55,16 +55,14 @@ def initial_input_generator(product_name: str) -> FormGenerator:
...
@@ -55,16 +55,14 @@ def initial_input_generator(product_name: str) -> FormGenerator:
vlan_range_label
:
Label
=
Field
(
"
Please set a VLAN range, bounds including.
"
,
exclude
=
True
)
vlan_range_label
:
Label
=
Field
(
"
Please set a VLAN range, bounds including.
"
,
exclude
=
True
)
vlan_range_lower_bound
:
VLAN_ID
vlan_range_lower_bound
:
VLAN_ID
vlan_range_upper_bound
:
VLAN_ID
vlan_range_upper_bound
:
VLAN_ID
else
:
vlan_range_lower_bound
:
ReadOnlyField
(
None
,
default_type
=
int
)
vlan_range_lower_bound
:
ReadOnlyField
(
int
)
=
None
vlan_range_upper_bound
:
ReadOnlyField
(
None
,
default_type
=
int
)
vlan_range_upper_bound
:
ReadOnlyField
(
int
)
=
None
vlan_divider
:
Divider
=
Field
(
None
,
exclude
=
True
)
vlan_divider
:
Divider
=
Field
(
None
,
exclude
=
True
)
if
initial_user_input
.
policer_enabled
:
if
initial_user_input
.
policer_enabled
:
policer_bandwidth
:
BandwidthString
policer_bandwidth
:
BandwidthString
else
:
policer_bandwidth
:
ReadOnlyField
(
None
,
default_type
=
str
)
policer_bandwidth
:
ReadOnlyField
(
str
)
=
None
policer_divider
:
Divider
=
Field
(
None
,
exclude
=
True
)
policer_divider
:
Divider
=
Field
(
None
,
exclude
=
True
)
...
@@ -87,15 +85,15 @@ def create_subscription(product: UUIDstr, partner: str) -> State:
...
@@ -87,15 +85,15 @@ def create_subscription(product: UUIDstr, partner: str) -> State:
@step
(
"
Initialize subscription
"
)
@step
(
"
Initialize subscription
"
)
def
initialize_subscription
(
def
initialize_subscription
(
subscription
:
Layer2CircuitInactive
,
subscription
:
Layer2CircuitInactive
,
layer_2_circuit_side_a
:
dict
[
str
,
Any
],
layer_2_circuit_side_a
:
dict
[
str
,
Any
],
layer_2_circuit_side_b
:
dict
[
str
,
Any
],
layer_2_circuit_side_b
:
dict
[
str
,
Any
],
virtual_circuit_id
:
VC_ID
|
None
,
virtual_circuit_id
:
VC_ID
|
None
,
layer_2_circuit_type
:
Layer2CircuitType
,
layer_2_circuit_type
:
Layer2CircuitType
,
vlan_range_lower_bound
:
VLAN_ID
|
None
,
vlan_range_lower_bound
:
VLAN_ID
|
None
,
vlan_range_upper_bound
:
VLAN_ID
|
None
,
vlan_range_upper_bound
:
VLAN_ID
|
None
,
policer_enabled
:
bool
,
# noqa: FBT001
policer_enabled
:
bool
,
# noqa: FBT001
policer_bandwidth
:
BandwidthString
|
None
,
policer_bandwidth
:
BandwidthString
|
None
,
)
->
State
:
)
->
State
:
"""
Build a subscription object from all user input.
"""
"""
Build a subscription object from all user input.
"""
subscription
.
layer_2_circuit
.
layer_2_circuit_sides
=
[
subscription
.
layer_2_circuit
.
layer_2_circuit_sides
=
[
...
...
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