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
ea835ed0
Commit
ea835ed0
authored
1 year ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
Address SonarQube code smells
parent
1295b282
No related branches found
No related tags found
No related merge requests found
Pipeline
#84548
passed
1 year ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/services/netbox_client.py
+1
-2
1 addition, 2 deletions
gso/services/netbox_client.py
gso/utils/device_info.py
+2
-2
2 additions, 2 deletions
gso/utils/device_info.py
gso/workflows/iptrunk/migrate_iptrunk.py
+7
-5
7 additions, 5 deletions
gso/workflows/iptrunk/migrate_iptrunk.py
with
10 additions
and
9 deletions
gso/services/netbox_client.py
+
1
−
2
View file @
ea835ed0
...
@@ -145,7 +145,7 @@ class NetboxClient:
...
@@ -145,7 +145,7 @@ class NetboxClient:
"""
Create a new device in Netbox.
"""
"""
Create a new device in Netbox.
"""
# Get device type id
# Get device type id
tier_info
=
TierInfo
().
get_module_by_name
(
f
"
T
ier
{
site_tier
}
"
)
tier_info
=
TierInfo
().
get_module_by_name
(
f
"
t
ier
{
site_tier
}
"
)
device_type
=
self
.
netbox
.
dcim
.
device_types
.
get
(
model
=
tier_info
.
device_type
)
device_type
=
self
.
netbox
.
dcim
.
device_types
.
get
(
model
=
tier_info
.
device_type
)
# Get device role id
# Get device role id
...
@@ -261,7 +261,6 @@ class NetboxClient:
...
@@ -261,7 +261,6 @@ class NetboxClient:
):
):
interface
.
lag
=
None
interface
.
lag
=
None
interface
.
save
()
interface
.
save
()
return
def
get_available_lags
(
self
,
router_id
:
UUID
)
->
list
[
str
]:
def
get_available_lags
(
self
,
router_id
:
UUID
)
->
list
[
str
]:
"""
Return all available :term:`LAG`s not assigned to a device.
"""
"""
Return all available :term:`LAG`s not assigned to a device.
"""
...
...
This diff is collapsed.
Click to expand it.
gso/utils/device_info.py
+
2
−
2
View file @
ea835ed0
...
@@ -11,14 +11,14 @@ class ModuleInfo(BaseModel):
...
@@ -11,14 +11,14 @@ class ModuleInfo(BaseModel):
class
TierInfo
:
class
TierInfo
:
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
self
.
T
ier1
=
ModuleInfo
(
self
.
t
ier1
=
ModuleInfo
(
device_type
=
"
7750 SR-7s
"
,
device_type
=
"
7750 SR-7s
"
,
module_bays_slots
=
[
1
,
2
],
module_bays_slots
=
[
1
,
2
],
module_type
=
"
XMA2-s-36p-400g
"
,
module_type
=
"
XMA2-s-36p-400g
"
,
breakout_interfaces_per_slot
=
[
36
,
35
,
34
,
33
],
breakout_interfaces_per_slot
=
[
36
,
35
,
34
,
33
],
total_10g_interfaces
=
80
,
total_10g_interfaces
=
80
,
)
)
self
.
T
ier2
=
ModuleInfo
(
self
.
t
ier2
=
ModuleInfo
(
device_type
=
"
7750-SR7s
"
,
device_type
=
"
7750-SR7s
"
,
module_bays_slots
=
[
1
,
2
],
module_bays_slots
=
[
1
,
2
],
module_type
=
"
XMA2-s-36p-400g
"
,
module_type
=
"
XMA2-s-36p-400g
"
,
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/migrate_iptrunk.py
+
7
−
5
View file @
ea835ed0
...
@@ -35,6 +35,8 @@ from gso.utils.helpers import (
...
@@ -35,6 +35,8 @@ from gso.utils.helpers import (
logger
=
getLogger
(
__name__
)
logger
=
getLogger
(
__name__
)
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
=
"
Playbook verb is not yet properly set.
"
def
initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
def
initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
subscription
=
Iptrunk
.
from_subscription
(
subscription_id
)
subscription
=
Iptrunk
.
from_subscription
(
subscription_id
)
...
@@ -232,7 +234,7 @@ def deploy_new_config_dry(
...
@@ -232,7 +234,7 @@ def deploy_new_config_dry(
"
trunk_interface
"
,
"
trunk_interface
"
,
)
)
logger
.
warning
(
"
Playbook verb is not yet properly set.
"
)
logger
.
warning
(
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
)
return
{
return
{
"
subscription
"
:
subscription
,
"
subscription
"
:
subscription
,
...
@@ -264,7 +266,7 @@ def deploy_new_config_real(
...
@@ -264,7 +266,7 @@ def deploy_new_config_real(
False
,
False
,
)
)
logger
.
warning
(
"
Playbook verb is not yet properly set.
"
)
logger
.
warning
(
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
)
return
{
return
{
"
subscription
"
:
subscription
,
"
subscription
"
:
subscription
,
...
@@ -315,7 +317,7 @@ def deploy_new_isis(
...
@@ -315,7 +317,7 @@ def deploy_new_isis(
False
,
False
,
)
)
logger
.
warning
(
"
Playbook verb is not yet properly set.
"
)
logger
.
warning
(
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
)
return
{
return
{
"
subscription
"
:
subscription
,
"
subscription
"
:
subscription
,
...
@@ -371,7 +373,7 @@ def delete_old_config_dry(
...
@@ -371,7 +373,7 @@ def delete_old_config_dry(
"
delete
"
,
"
delete
"
,
)
)
logger
.
warning
(
"
Playbook verb is not yet properly set.
"
)
logger
.
warning
(
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
...
@@ -401,7 +403,7 @@ def delete_old_config_real(
...
@@ -401,7 +403,7 @@ def delete_old_config_real(
False
,
False
,
)
)
logger
.
warning
(
"
Playbook verb is not yet properly set.
"
)
logger
.
warning
(
PLAYBOOK_VERB_NOT_YET_PROPERLY_SET
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
...
...
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