Skip to content
Snippets Groups Projects
Commit 4ee04a6a authored by Francisco Garcia Alvarez's avatar Francisco Garcia Alvarez
Browse files

Fix bug 1030 forcing to wait taskIds


Changelog:
- Fix bug 1030 by Oscar
- Changed comments in configLets according to Itsaso suggestions
- Fix bug in rollback call (modified time to wait in tasks and rollback)

Change-Id: Ib5eadfb44f9d6ff8cd9dbeacc640c925d65d3ea3
Signed-off-by: default avatarFrancisco Garcia Alvarez <francisco.galvarez@atos.net>
parent 79870eac
No related branches found
No related tags found
No related merge requests found
......@@ -30,16 +30,16 @@
class AristaSDNConfigLet:
_configLet_SRIOV = """
!# service: {}
interface {}
interface {interface}
!! service: {uuid}
switchport
switchport mode trunk
switchport trunk group {}{}
switchport trunk group {service}{vlan_id}
!
"""
def _get_sriov(self, uuid, interface, vlan_id, s_type, index):
return self._configLet_SRIOV.format(uuid, interface, s_type, vlan_id)
return self._configLet_SRIOV.format(uuid=uuid, interface=interface, service=s_type, vlan_id=vlan_id)
def getElan_sriov(self, uuid, interface, vlan_id, index):
return self._get_sriov(uuid, interface, vlan_id, "ELAN", index)
......@@ -48,16 +48,16 @@ interface {}
return self._get_sriov(uuid, interface, vlan_id, "ELINE", index)
_configLet_PASSTROUGH = """
!# service: {}
interface {}
interface {interface}
!! service: {uuid}
switchport
switchport mode access
switchport access vlan {}
switchport access vlan {vlan_id}
!
"""
def _get_passthrough(self, uuid, interface, vlan_id, s_type, index):
return self._configLet_PASSTROUGH.format(uuid, interface, vlan_id)
return self._configLet_PASSTROUGH.format(uuid=uuid, interface=interface, vlan_id=vlan_id)
def getElan_passthrough(self, uuid, interface, vlan_id, index):
return self._get_passthrough(uuid, interface, vlan_id, "ELAN", index)
......@@ -66,8 +66,8 @@ interface {}
return self._get_passthrough(uuid, interface, vlan_id, "ELINE", index)
_configLet_VLAN = """
!## service: {service} {vlan} {uuid}
vlan {vlan}
!! service: {service} {vlan} {uuid}
name {service}{vlan}
trunk group {service}{vlan}
trunk group MLAGPEER
......@@ -87,9 +87,9 @@ interface VXLAN1
return self._get_vlan(uuid, vlan_id, vni_id, "ELINE")
_configLet_BGP = """
!# service: {uuid}
router bgp {bgp}
vlan {vlan}
!! service: {uuid}
rd {loopback}:{vni}
route-target both {vni}:{vni}
redistribute learned
......
......@@ -122,8 +122,8 @@ class AristaSdnConnector(SdnConnectorBase):
__OSM_PREFIX = "osm_"
__OSM_METADATA = "OSM_metadata"
__METADATA_PREFIX = '!## Service'
__EXC_TASK_EXEC_WAIT = 1
__ROLLB_TASK_EXEC_WAIT = 5
__EXC_TASK_EXEC_WAIT = 10
__ROLLB_TASK_EXEC_WAIT = 10
def __init__(self, wim, wim_account, config=None, logger=None):
"""
......@@ -777,8 +777,8 @@ class AristaSdnConnector(SdnConnectorBase):
except Exception as ex:
try:
self.__rollbackConnection(cls_perSw,
allLeafConfigured=True,
allLeafModified=True)
allLeafConfigured,
allLeafModified)
except Exception as e:
self.logger.info("Exception rolling back in updating connection: {}".
format(e))
......@@ -1000,7 +1000,8 @@ class AristaSdnConnector(SdnConnectorBase):
resp = self.client.api.update_configlet(
configlet['config'],
configlet['data']['key'],
configlet['data']['name'])
configlet['data']['name'],
wait_task_ids=True)
elif to_create:
operation = 'create'
resp = self.client.api.add_configlet(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment