Skip to content

Commit

Permalink
Releasing v24.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Ryan committed May 27, 2024
1 parent b799197 commit 9bb7a89
Show file tree
Hide file tree
Showing 273 changed files with 13,344 additions and 1,029 deletions.
33 changes: 33 additions & 0 deletions pkgs/clean-pkg/changelog/2024/may.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe
* The clean stages 'verify_running_image' and 'copy_to_device' were using the 'xe_version' field
* Also fixed the wrong default type when calling get on a dict in 'verify_running_image'.

* clean/stages
* iosxe
* update install remove inactive stage to check for the image before remvoving image and packages.

* clean
* Modified recovery_processor
* Added condition to check if device has is_ha attribute


--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* clean/iosxe
* Connect
* Added logic to iosxe connect stage to support HA recovery.

* iosxe/cat9k
* Added new clean stage `install_image`

* clean
* Modified clean.py
* Added resources to NOT_A_STAGE variable.


129 changes: 49 additions & 80 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__ = '24.4'
__version__ = '24.5'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Logger
log = logging.getLogger(__name__)

NOT_A_STAGE = ['device_recovery', 'images', 'order', 'mgt_itf', 'template']
NOT_A_STAGE = ['device_recovery', 'images', 'order', 'mgt_itf', 'template', 'resources']

GLOBAL_STAGE_REUSE_LIMIT = 3

Expand Down
9 changes: 9 additions & 0 deletions pkgs/clean-pkg/src/genie/libs/clean/exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CleanException(Exception):
''' base class '''
pass

class StackMemberConfigException(CleanException):
"""
Exception for when all the member of stack device is configured
"""
pass
2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def recovery_processor(
log.exception(f'Could not bring device to any valid state! Continue with recovery because of {e}.')
recovery_is_required = True
# Device is in rommon. try to boot the device before continuing with other recovery steps
if device.is_ha:
if hasattr(device, 'is_ha') and device.is_ha:
if not recovery_is_required and check_all_in_same_state(device, 'enable'):
log.info('Device is already connected. No need for device recovery.')
return
Expand Down
14 changes: 10 additions & 4 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/cheetah/ap/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ class LoadApImage(BaseStage):
protocol(str): protocol through which AP image will be loaded
retries(int, optional): Number of times image download needs to be tried
max_time (int, optional): Maximum time for which this clean stage will try to clean ap.
Defaults to 1200
Expand All @@ -211,6 +213,8 @@ class LoadApImage(BaseStage):
# =================
MAX_TIME = 1200
PROTOCOL = "http"
RETRIES = 1
RETRY_SLEEP_TIME = 30

# ============
# Stage Schema
Expand All @@ -219,6 +223,7 @@ class LoadApImage(BaseStage):
"server": str,
Optional("ap_image_path"): str,
Optional("protocol"): str,
Optional('retries'): int,
Optional('max_time'): int,
}

Expand All @@ -229,7 +234,7 @@ class LoadApImage(BaseStage):
'load_image'
]

def load_image(self, device, steps, ap_image_path, server, protocol=PROTOCOL, max_time=MAX_TIME):
def load_image(self, device, steps, ap_image_path, server, protocol=PROTOCOL, max_time=MAX_TIME, retries=RETRIES, retry_sleep_time=RETRY_SLEEP_TIME):
try:
if not hasattr(device.testbed, 'servers'):
self.failed("Cannot find any servers in the testbed")
Expand All @@ -239,11 +244,12 @@ def load_image(self, device, steps, ap_image_path, server, protocol=PROTOCOL, ma
with steps.start("Load image in to device-{} and verify if its loaded correctly".format(device.name)) as step:
if not ap_image_path.startswith("/"):
ap_image_path = "/" + ap_image_path
full_image_path = "{}://{}:{}".format(protocol, server_ip, ap_image_path)
if not device.api.execute_archive_download(full_image_path, max_time, username, password, reload=True):
full_image_path = "{}://{}{}".format(protocol, server_ip, ap_image_path)
if not device.api.execute_archive_download(full_image_path, max_time, username, password, reload=True, retries=retries,
retry_sleep_time=retry_sleep_time):
step.failed("Failed to load AP image")
except Exception as e:
log.exception(e)
self.failed("Failed to load image on AP")


Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Enable abstraction using this directory name as the abstraction token
try:
from genie import abstract
abstract.declare_token(platform='cat9k', model='c9500')
except Exception as e:
import warnings
warnings.warn('Could not declare abstraction token: ' + str(e))
from genie import abstract
abstract.declare_token(model='c9500')
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Enable abstraction using this directory name as the abstraction token
try:
from genie import abstract
abstract.declare_token(platform='cat9k', model='c9800')
except Exception as e:
import warnings
warnings.warn('Could not declare abstraction token: ' + str(e))
from genie import abstract
abstract.declare_token(model='c9800')
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from genie import abstract
abstract.declare_token(submodel='c9800_cl')
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
# Enable abstraction using this directory name as the abstraction token
try:
from genie import abstract
abstract.declare_token(platform='cat9k', submodel='c9800_cl')
except Exception as e:
import warnings
warnings.warn('Could not declare abstraction token: ' + str(e))
Loading

0 comments on commit 9bb7a89

Please sign in to comment.