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
91e16db4
Commit
91e16db4
authored
1 year ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
Address SonarQube duplicated lines in create_site.py
parent
12dbf6d4
No related branches found
No related tags found
1 merge request
!112
Address SonarQube code smells
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/site/create_site.py
+1
-3
1 addition, 3 deletions
gso/workflows/site/create_site.py
with
1 addition
and
3 deletions
gso/workflows/site/create_site.py
+
1
−
3
View file @
91e16db4
...
...
@@ -43,7 +43,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
@validator
(
"
site_ts_address
"
,
allow_reuse
=
True
)
def
validate_ts_address
(
cls
,
site_ts_address
:
str
)
->
str
:
"""
Validate that a terminal server address is valid.
"""
validate_site_fields_is_unique
(
"
site_ts_address
"
,
site_ts_address
)
validate_ipv4_or_ipv6
(
site_ts_address
)
return
site_ts_address
...
...
@@ -53,7 +52,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
validate_country_code
(
country_code
)
return
country_code
@validator
(
"
site_internal_id
"
,
"
site_bgp_community_id
"
,
allow_reuse
=
True
)
@validator
(
"
site_ts_address
"
,
"
site_internal_id
"
,
"
site_bgp_community_id
"
,
"
site_name
"
,
allow_reuse
=
True
)
def
validate_unique_fields
(
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
)
...
...
@@ -64,7 +63,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
The site name must consist of three uppercase letters, followed by an optional single digit.
"""
validate_site_fields_is_unique
(
"
site_name
"
,
site_name
)
validate_site_name
(
site_name
)
return
site_name
...
...
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