Skip to content
Snippets Groups Projects
Commit ea835ed0 authored by JORGE SASIAIN's avatar JORGE SASIAIN
Browse files

Address SonarQube code smells

parent 1295b282
No related branches found
No related tags found
No related merge requests found
Pipeline #84548 passed
...@@ -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"Tier{site_tier}") tier_info = TierInfo().get_module_by_name(f"tier{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."""
......
...@@ -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.Tier1 = ModuleInfo( self.tier1 = 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.Tier2 = ModuleInfo( self.tier2 = 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",
......
...@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment