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
Jira
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
f67b24c7
Commit
f67b24c7
authored
1 year ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
NAT-329
: remove accidentally commited file
parent
a87f48fe
No related branches found
No related tags found
No related merge requests found
Pipeline
#84645
failed
1 year ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/utils/validators.py
+0
-36
0 additions, 36 deletions
gso/utils/validators.py
with
0 additions
and
36 deletions
gso/utils/validators.py
deleted
100644 → 0
+
0
−
36
View file @
a87f48fe
from
pydantic
import
BaseModel
,
validator
,
ModelField
from
gso.utils.helpers
import
(
validate_country_code
,
validate_ipv4_or_ipv6
,
validate_site_fields_is_unique
,
validate_site_name
,
)
def
common_ts_address_validator
(
cls
,
site_ts_address
:
str
)
->
str
:
"""
Validate that a terminal server address is valid.
"""
validate_ipv4_or_ipv6
(
site_ts_address
)
return
site_ts_address
def
common_country_code_validator
(
cls
,
country_code
:
str
)
->
str
:
"""
Validate that the country code exists.
"""
validate_country_code
(
country_code
)
return
country_code
def
common_unique_fields_validator
(
cls
,
value
:
str
,
field
:
ModelField
)
->
str
|
int
:
"""
Validate that the internal and :term:`BGP` community IDs are unique.
"""
return
validate_site_fields_is_unique
(
field
.
name
,
value
)
def
common_site_name_validator
(
cls
,
site_name
:
str
)
->
str
:
"""
Validate the site name.
The site name must consist of three uppercase letters, followed by an optional single digit.
"""
validate_site_name
(
site_name
)
return
site_name
def
validator_decorator
(
func
):
def
wrapper
(
cls
,
*
args
,
**
kwargs
):
return
validator
(
func
.
__name__
,
pre
=
True
,
allow_reuse
=
True
)(
*
args
,
**
kwargs
)
return
wrapper
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