Skip to content

Commit

Permalink
Releasing v25.1
Browse files Browse the repository at this point in the history
  • Loading branch information
omehrabi committed Feb 3, 2025
1 parent 6df5e8f commit 9a3980a
Show file tree
Hide file tree
Showing 387 changed files with 8,959 additions and 85,066 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ distribute:
@test -d $(DIST_DIR) || { echo "Nothing to distribute! Exiting..."; exit 1; }
@echo "Organizing distributable into folders"
@organize_dist --dist $(DIST_DIR)
@rsync -rtlv --progress $(DIST_DIR)/* $(PROD_USER):$(PROD_PKGS)
@rsync -rtlpv --progress $(DIST_DIR)/* $(PROD_USER):$(PROD_PKGS)
@echo ""
@echo "Done."
@echo ""
Expand All @@ -252,7 +252,7 @@ distribute_staging:
@test -d $(DIST_DIR) || { echo "Nothing to distribute! Exiting..."; exit 1; }
@echo "Organizing distributable into folders"
@organize_dist --dist $(DIST_DIR)
@rsync -rtlv --progress $(DIST_DIR)/* $(PROD_USER):$(STAGING_PKGS)
@rsync -rtlpv --progress $(DIST_DIR)/* $(PROD_USER):$(STAGING_PKGS)
@echo ""
@echo "Done."
@echo ""
Expand Down Expand Up @@ -321,7 +321,7 @@ json:
@echo "--------------------------------------------------------------------"
@echo "Generating libs json file"
@echo ""
@python3 -W ignore::SyntaxWarning -c "from genie.json.make_json import make_genielibs; make_genielibs()"
@python3 -c "from genie.json.make_json import make_genielibs; make_genielibs()"
@echo ""
@echo "Done."
@echo ""
Expand Down
31 changes: 31 additions & 0 deletions pkgs/clean-pkg/changelog/2025/january.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe
* Modified ChangeBootVariable
* Removed duplicate code from verify_boot_variable step

* clean-pkg
* iosxe
* set the step as passx if ignore stratup config fail.
* Fix syntax warning


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

* clean-pkg
* iosxe
* Remove the unused key `reload_timeout` from `install_smu`
* iosxe
* Added hot smu support for `install_remove_smu` and `install_smu` stage
* iosxe
* Added multiple smu support for `install_remove_smu` and `install_smu` stage

* iosxe
* Added
* ChangeBootVariable for IE3K


1,224 changes: 0 additions & 1,224 deletions pkgs/clean-pkg/sdk_generator/output/github_clean.json

This file was deleted.

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.11'
__version__ = '25.1'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def grub_breakboot(spawn, break_char):
device.instantiate(connection_timeout=timeout)

# Get device console port information
last_word_in_start_match = re.match('.*\s(\S+)$', start)
last_word_in_start_match = re.match(r'.*\s(\S+)$', start)
last_word_in_start = last_word_in_start_match.group(1) \
if last_word_in_start_match else ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def device_recovery(start, device, console_activity_pattern, golden_image=None,
device.instantiate(connection_timeout=timeout)

# Get device console port information
last_word_in_start_match = re.match('.*\s(\S+)$', start)
last_word_in_start_match = re.match(r'.*\s(\S+)$', start)
last_word_in_start = last_word_in_start_match.group(1) \
if last_word_in_start_match else ""

Expand Down Expand Up @@ -130,7 +130,7 @@ def tftp_recovery_worker(start, device, console_activity_pattern, tftp_boot=None
device.instantiate(connection_timeout=timeout)

# Get device console port information
last_word_in_start_match = re.match('.*\s(\S+)$', start)
last_word_in_start_match = re.match(r'.*\s(\S+)$', start)
last_word_in_start = last_word_in_start_match.group(1) \
if last_word_in_start_match else ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def bash_prompt_handler(spawn, session, context):
# clean up disk space in case NXOS goes to bash prompt during reload
# no info about protected_files in this situation, so protect only given
# golden image and delete other thinkable image files
m = re.search("'(?P<storage>\S+)' is FULL", spawn.buffer)
m = re.search(r"'(?P<storage>\S+)' is FULL", spawn.buffer)
if m:
spawn.buffer = ''
storage = m.group('storage')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def device_recovery(start, device, console_activity_pattern, golden_image=None,
device.instantiate(connection_timeout=timeout)

# Get device console port information
last_word_in_start_match = re.match('.*\s(\S+)$', start)
last_word_in_start_match = re.match(r'.*\s(\S+)$', start)
last_word_in_start = last_word_in_start_match.group(1) \
if last_word_in_start_match else ""

Expand Down
43 changes: 27 additions & 16 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def _check_for_member_config(spawn, session):
if not session.get('member_config'):
raise StackMemberConfigException

install_add_one_shot_dialog = Dialog([
dialog = Dialog([
Statement(pattern=r"Do you want to proceed\? \[y\/n\]",
action='sendline(y)',
loop_continue=True,
Expand All @@ -943,22 +943,33 @@ def _check_for_member_config(spawn, session):
loop_continue=True,
continue_timer=False)
])

if issu:
device.sendline('install add file {} activate issu commit'.format(images[0]))
else:
device.sendline('install add file {} activate commit'.format(images[0]))

try:
reload_args.update(
{"timeout": install_timeout, "reply": install_add_one_shot_dialog}
)
if issu:
device.reload("install add file {} activate issu commit".format(
images[0]
),
**reload_args,
)
else:
device.reload("install add file {} activate commit".format(
images[0]
),
**reload_args,
)
dialog.process(device.spawn,
timeout = install_timeout,
context=device.context)
except StackMemberConfigException:
log.debug("Expected exception continue with the stage")
log.info('Waiting for buffer to settle down')
post_reload_wait_time = reload_args.get('post_reload_wait', 15)
post_reload_timeout = reload_args.get('post_reload_timeout', 60)
start_time = current_time = datetime.now()
timeout_time = timedelta(seconds=post_reload_timeout)
settle_time = current_time = datetime.now()
while (current_time - settle_time) < timeout_time:
if buffer_settled(device.spawn, post_reload_wait_time):
log.info('Buffer settled, accessing device..')
break
current_time = datetime.now()
if (current_time - start_time) > timeout_time:
log.info('Time out, trying to access device..')
break
device.enable()
except Exception as e:
step.failed("Failed to install the image", from_exception=e)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_iosxe_install_image_pass(self):

device = Mock()
device.chassis_type = 'stack'
device.reload = Mock()
device.sendline = Mock()
# device.api.get_running_image.return_value = 'sftp://server/image.bin'

with patch(
Expand All @@ -35,7 +35,7 @@ def test_iosxe_install_image_pass(self):
"genie.libs.clean.stages.iosxe.cat9k.stages.Dialog") as dialog_mock:
cls.install_image(steps=steps, device=device, images=['sftp://server/image.bin'])

device.reload([
device.sendline.assert_has_calls([
call('install add file sftp://server/image.bin activate commit')])
self.assertEqual(Passed, steps.details[0].result)

Expand All @@ -46,7 +46,6 @@ def test_iosxe_install_image_skip(self):
device = Mock()
device.chassis_type = 'stack'
device.api.get_running_image.return_value = 'sftp://server/image.bin'
device.reload = Mock(side_effect=Exception)
with self.assertRaises(TerminateStepSignal):
with patch(
"genie.libs.clean.stages.iosxe.cat9k.stages.StackUtils") as stack_mock:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Enable abstraction using this directory name as the abstraction token
try:
from genie import abstract
abstract.declare_token(platform='ie3k')
except Exception as e:
import warnings
warnings.warn('Could not declare abstraction token: ' + str(e))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from genie import abstract
abstract.declare_token(model='ie3100')
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""IOSXE IE3100 specific clean stages"""

# Python
import logging

# Genie
from genie.libs.clean.stages.iosxe.stages import (
ChangeBootVariable as IOSXEChangeBootVariable)

# MetaParser
from genie.metaparser.util.schemaengine import Optional

# Logger
log = logging.getLogger(__name__)


class ChangeBootVariable(IOSXEChangeBootVariable):
"""This stage configures boot variables of the device using the following steps:
- Delete existing boot variables.
- Configure boot variables using the provided 'images'.
- Write memory.
- Verify the boot variables are as expected.
Stage Schema
------------
change_boot_variable:
images (list): Image files to use when configuring the boot variables.
timeout (int, optional): Execute timeout in seconds. Defaults to 300.
current_running_image (bool, optional): Set the boot variable to the currently
running image from the show version command instead of the image provided.
Defaults to False.
Example
-------
change_boot_variable:
images:
- harddisk:/image.bin
timeout: 150
"""

# =================
# Argument Defaults
# =================
TIMEOUT = 300
CURRENT_RUNNING_IMAGE = False

# ============
# Stage Schema
# ============
schema = {
Optional('images'): list,
Optional('timeout'): int,
Optional('current_running_image'): bool,

# Deprecated
Optional('check_interval'): int,
Optional('max_time'): int,
Optional('write_memory'): bool,
}

# ==============================
# Execution order of Stage steps
# ==============================
exec_order = [
'delete_boot_variable',
'configure_boot_variable',
'write_memory',
'verify_boot_variable'
]

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from genie import abstract
abstract.declare_token(model='ie3200')
Loading

0 comments on commit 9a3980a

Please sign in to comment.