Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pkgs/clean-pkg/changelog/2025/august.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe/copy_to_device
* Added md5 verification before copying the image to the device.

* stages
* Install image reloads to Press Enter key add a statement to handle return key after the image reloads.

* iosxe
* Modified clean connect to handle exhaused credentials error and trigger password recovery

* clean-pkg
* Added delay after applying configuration to the device
* iosxe
* Updated the logic to work for ha/stack device in install image and install SMU stages
* Increased the timeout to 3 minutes since by default the image take time to be applied.

* iosxe/connect
* Removed duplicate configure rommon variable in connect stage.


34 changes: 17 additions & 17 deletions pkgs/clean-pkg/sdk_generator/output/github_clean.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
2,501 changes: 1,411 additions & 1,090 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3145,6 +3145,9 @@ class ConfigureManagement(BaseStage):
alias_as_hostname (bool): When used with `set_hostname`, will use the
alias as the hostname. (default: False)

config_stable_time (int, optional): Max time in seconds allowed for the
configuration to stabilize. Defaults to 10.


Example
-------
Expand All @@ -3157,6 +3160,7 @@ class ConfigureManagement(BaseStage):
# Argument Defaults
# =================
SET_HOSTNAME = True
CONFIG_STABLE_TIME = 10

# ============
# Stage Schema
Expand Down Expand Up @@ -3186,6 +3190,7 @@ class ConfigureManagement(BaseStage):
Optional('protocols'): ListOf(str),
Optional('set_hostname'): bool,
Optional('alias_as_hostname'): bool,
Optional('config_stable_time'): int,
}

# ==============================
Expand All @@ -3201,6 +3206,7 @@ def configure_management(self,
steps,
device,
set_hostname=SET_HOSTNAME,
config_stable_time=CONFIG_STABLE_TIME,
**kwargs):
if "configure_management" not in dir(device.api):
self.passx("No support for configure_management API")
Expand All @@ -3216,6 +3222,8 @@ def configure_management(self,

if hasattr(device, "management") and device.management:
device.api.configure_management(**config_kwargs)
log.info(f"Waiting {config_stable_time} seconds for the configuration to be applied")
time.sleep(config_stable_time)
else:
step.passx("No management info for device")

Expand Down
9 changes: 9 additions & 0 deletions pkgs/conf-pkg/changelog/2025/august.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* nxos
* Modified Service-Acceleration
* Added service vlan keys to service-acceleration conf model


2 changes: 1 addition & 1 deletion pkgs/conf-pkg/src/genie/libs/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'''

# metadata
__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ def build_config(self, apply=True, attributes=None, unconfig=False,
configurations.append_block(servicevrf_key.build_config(
apply=False, attributes=attributes2, **kwargs))

# ServiceVlan attributes config
for servicevlan_key, attributes2 in attributes.sequence_values('servicevlan_keys', sort=True):
if unconfig:
configurations.append_block(servicevlan_key.build_unconfig(
apply=False, attributes=attributes2, **kwargs))
else:
configurations.append_block(servicevlan_key.build_config(
apply=False, attributes=attributes2, **kwargs))

return str(configurations)

def build_unconfig(self, apply=True, attributes=None, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'''
Service-Acceleration Genie Conf Object Implementation for NXOS:
- ServiceVlan multi-line configuration implementation for NXOS - CLI
'''

# Python
import re
import warnings
from abc import ABC

# Genie
from genie.conf.base.cli import CliConfigBuilder
from genie.conf.base.attributes import AttributesHelper


class ServiceVlan(ABC):

def build_config(self, apply=True, attributes=None, unconfig=False,
**kwargs):
attributes = AttributesHelper(self, attributes)
configurations = CliConfigBuilder(unconfig=unconfig)

# service system hypershield
# service firewall
# vlan id 2 bridged-traffic module-affinity 1
# vlan id 3 bridged-traffic module-affinity dynamic
if attributes.value('service_vlan_name'):
configurations.append_line(
attributes.format('vlan id {service_vlan_name} bridged-traffic module-affinity {module_affinity}'))

return str(configurations)

def build_unconfig(self, apply=True, attributes=None, **kwargs):
return self.build_config(apply=apply, attributes=attributes,
unconfig=True, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Genie Conf
from genie.libs.conf.service_acceleration import ServiceAcceleration
from genie.libs.conf.service_acceleration.service_vrf import ServiceVrf
from genie.libs.conf.service_acceleration.service_vlan import ServiceVlan


class test_service_acceleration(TestCase):
Expand Down Expand Up @@ -145,6 +146,10 @@ def test_service_acceleration_service_attributes(self):
vrf2.module_affinity = 1
serv_acc.device_attr[dev1].service_attr['firewall'].add_servicevrf_key(vrf2)

vlan1 = ServiceVlan(device=dev1)
vlan1.service_vlan_name = 2
vlan1.module_affinity = 1
serv_acc.device_attr[dev1].service_attr['firewall'].add_servicevlan_key(vlan1)

# add feature to device
dev1.add_feature(serv_acc)
Expand All @@ -162,6 +167,25 @@ def test_service_acceleration_service_attributes(self):
' in-service\n'
' vrf vrfazure module-affinity 1\n'
' vrf vrfoci module-affinity dynamic\n'
' vlan id 2 bridged-traffic module-affinity 1\n'
' exit\n'
' exit'
]
),
)

# remove 1 vrf under firewall
partial_uncfg2 = serv_acc.build_unconfig(
apply=False,
attributes={'device_attr': {'*': {'service_attr':{'*': {'servicevlan_keys': vlan1}}}}})

self.assertMultiLineEqual(
str(partial_uncfg2[dev1.name]),
"\n".join(
[
'service system hypershield\n'
' service firewall\n'
' no vlan id 2 bridged-traffic module-affinity 1\n'
' exit\n'
' exit'
]
Expand Down Expand Up @@ -234,6 +258,11 @@ def test_service_acceleration_all_attributes(self):
vrf2.module_affinity = 1
serv_acc.device_attr[dev1].service_attr['firewall'].add_servicevrf_key(vrf2)

vlan1 = ServiceVlan(device=dev1)
vlan1.service_vlan_name = 2
vlan1.module_affinity = "dynamic"
serv_acc.device_attr[dev1].service_attr['firewall'].add_servicevlan_key(vlan1)

# add feature to device
dev1.add_feature(serv_acc)

Expand All @@ -255,6 +284,7 @@ def test_service_acceleration_all_attributes(self):
" in-service\n"
" vrf vrfaws module-affinity dynamic\n"
" vrf vrfazure module-affinity 1\n"
" vlan id 2 bridged-traffic module-affinity dynamic\n"
" exit\n"
" exit"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# multi-line config class
from .service_vrf import ServiceVrf
from .service_vlan import ServiceVlan

# service-acceleration Hierarchy
# --------------
Expand Down Expand Up @@ -65,6 +66,25 @@ def remove_servicevrf_key(self, servicevrf_key):
self.servicevrf_keys.remove(servicevrf_key)
except:
pass

# service vlan configs
servicevlan_keys = managedattribute(
name='servicevlan_keys',
finit=typedset(
managedattribute.test_isinstance(ServiceVlan)).copy,
type=typedset(managedattribute.test_isinstance(
ServiceVlan))._from_iterable,
doc='A `set` of ServiceVlan keys objects')

def add_servicevlan_key(self, servicevlan_key):
self.servicevlan_keys.add(servicevlan_key)

def remove_servicevrf_key(self, servicevlan_key):
servicevlan_key._device = None
try:
self.servicevlan_keys.remove(servicevlan_key)
except:
pass

service_attr = managedattribute(
name='service_attr',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
__all__ = (
'ServiceVlan',
)

# Python
import weakref
import functools

# Genie
from genie.decorator import managedattribute
from genie.conf.base import ConfigurableBase


@functools.total_ordering
class ServiceVlan(ConfigurableBase):

@property
def testbed(self):
return self.device.testbed

@property
def device(self):
return self._device()

# ==========================================================================
# MANAGED ATTRIBUTES
# ==========================================================================

# ServiceAcceleration
# +- DeviceAttributes
# +- ServiceAttributes

# service_vlan_name
service_vlan_name = managedattribute(
name='vlan_name',
default=None,
type=(None, managedattribute.test_istype(int)))

# module_affinity
module_affinity = managedattribute(
name="module_affinity",
default='dynamic',
type=(None, managedattribute.test_in({'dynamic',1, 2, 3, 4}))
)


# ==========================================================================

# Overload __eq__
def __eq__(self, other):
if not isinstance(other, ServiceVlan):
raise NotImplemented

return (self.service_vlan_name,
self.module_affinity,
self.device) == \
(other.service_vlan_name,
other.module_affinity,
other.device)

# Overload __lt__
def __lt__(self, other):
if not isinstance(other, ServiceVlan):
raise NotImplemented("Cannot compare '{s}' to a '{o}'".format(
s=type(self), o=type(other)))

return (self.service_vlan_name,
self.module_affinity,
self.device) < \
(other.service_vlan_name,
other.module_affinity,
other.device)

# Overload __hash__
def __hash__(self):
return hash((self.service_vlan_name,
self.module_affinity,
self.device))

# Overload __repr__
def __repr__(self):
return '%s object at 0x%x' % (
self.__class__.__name__,
id(self))

def __init__(self, device, *args, **kwargs):
self._device = weakref.ref(device)
super().__init__(*args, **kwargs)
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'''

__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/health-pkg/src/genie/libs/health/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/ops-pkg/src/genie/libs/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'''

# metadata
__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/robot-pkg/src/genie/libs/robot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = "25.7"
__version__ = "25.8"
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Loading