Skip to content

Commit

Permalink
Merge pull request #173 from CiscoTestAutomation/release_24.7
Browse files Browse the repository at this point in the history
release_24.7
  • Loading branch information
lsheikal authored Aug 1, 2024
2 parents 6e3d1b9 + 5e34a95 commit 1f781e0
Show file tree
Hide file tree
Showing 293 changed files with 10,267 additions and 32,084 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ CYTHON_CMD = compileAll
# Development pkg requirements
RELATED_PKGS = genie.libs.health genie.libs.clean genie.libs.conf genie.libs.ops genie.libs.robot genie.libs.sdk
RELATED_PKGS += genie.libs.filetransferutils
# pinning the version of pysnmp and pyasn1 to fix the type error when using execute_power_cycle_device api
# pinning the version of pysnmp-lextudio and pyasn1 to fix the type error when using execute_power_cycle_device api
# Adding pyasyncore pkg to fix pysnmp scripts for python 3.12
DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8 pyasyncore
DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==6.1.2 pyasn1==0.4.8 pyasyncore
DEPENDENCIES += sphinx-rtd-theme==1.1.0 pyftpdlib tftpy\<0.8.1 robotframework
DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2
# Internal variables.
Expand Down Expand Up @@ -200,6 +200,11 @@ develop:
@echo ""
@echo "Done."
@echo ""
@echo "--------------------------------------------------------------------"
@echo "Development environment has been setup."
@echo -e "\e[1;33mWarning: Do make json to generate json files to acccess the genie features!!!\e[0m"
@echo "--------------------------------------------------------------------"


undevelop:
@echo ""
Expand Down
25 changes: 25 additions & 0 deletions pkgs/clean-pkg/changelog/2024/july.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* iosxe
* Modified
* Added prompt-level none to image install command


--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe
* Recovery
* Refactored Recovery logic to use send_break_boot api.
* Reload
* Updated logic todo Reload when the boot variable is not set.
* Modified InstallRemoveInactive
* Added new parameter force_remove to remove inactive package forcefully
* Added dialog
* api
* Added condition for golden image


32 changes: 16 additions & 16 deletions pkgs/clean-pkg/sdk_generator/output/github_clean.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
"os": "iosxe"
},
"uid": "ConfigureReplace",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2026"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2099"
}
}
},
Expand Down Expand Up @@ -300,7 +300,7 @@
"os": "iosxe"
},
"uid": "Connect",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2082"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2155"
},
"linux": {
"folders": {
Expand Down Expand Up @@ -354,7 +354,7 @@
"os": "iosxe"
},
"uid": "CopyToDevice",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1381"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1454"
}
},
"module_name": "stages.stages",
Expand Down Expand Up @@ -512,7 +512,7 @@
"platform": "cat9k"
},
"uid": "InstallImage",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L759"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L757"
}
},
"module_name": "stages.iosxe.stages",
Expand All @@ -521,7 +521,7 @@
"os": "iosxe"
},
"uid": "InstallImage",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L535"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L545"
},
"iosxr": {
"folders": {
Expand Down Expand Up @@ -583,14 +583,14 @@
"os": "iosxe"
},
"uid": "InstallPackages",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L788"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L798"
}
}
},
"InstallRemoveInactive": {
"folders": {
"iosxe": {
"doc": "This stage removes partially installed packages/images left\non the device. If a super package is left partially installed,\nwe cannot attempt to install another until it is removed.\n\nStage Schema\n------------\ninstall_image:\n images (list, optional):\n image to not removed by stage.\n \n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\nExample\n-------\ninstall_remove_inactive:\n timeout: 180\n\n",
"doc": "This stage removes partially installed packages/images left\non the device. If a super package is left partially installed,\nwe cannot attempt to install another until it is removed.\n\nStage Schema\n------------\ninstall_image:\n images (list, optional):\n image to not removed by stage.\n \n timeout (int, optional): Maximum time to wait for remove process to\n finish. Defaults to 180.\n\n force_remove (bool, optional): Whether or not to remove the inactive\n package irrespective of availability of passed image. Defaults to True.\n\nExample\n-------\ninstall_remove_inactive:\n timeout: 180\n\n",
"module_name": "stages.iosxe.stages",
"package": "genie.libs.clean",
"tokens": {
Expand Down Expand Up @@ -691,14 +691,14 @@
"doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex patterns to check for errors.\n Defaults to an empty list (no error checking).\n\n <Key>: <Value>\n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n",
"folders": {
"iosxe": {
"doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n <Key>: <Value>\n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n",
"doc": " This stage reloads the device.\n\nStage Schema\n------------\nreload:\n license: (optional)\n check: (bool, optional): Enable the checking license inconsistency and fix\n\n reload_service_args (optional):\n\n timeout (int, optional): Maximum time in seconds allowed for the reload.\n Defaults to 800.\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n\n <Key>: <Value>\n Any other arguments that the Unicon reload service supports\n\n check_modules:\n\n check (bool, optional): Enable the checking of modules after reload.\n Defaults to True.\n\n timeout (int, optional): Maximum time in seconds allowed for verifying\n the modules are in a stable state. Defaults to 180.\n\n interval (int, optional): How often to check the module states in\n seconds. Defaults to 30.\n\n reconnect_via (str, optional): Specify which connection to use after reloading.\n Defaults to the 'default' connection in the testbed yaml file.\n\n attempt_manual_boot (bool, optional): Enable to attempt manual boot when reload fails.\n Defaults to True.\n\nExample\n-------\nreload:\n reload_service_args:\n timeout: 600\n reload_creds: clean_reload_creds\n prompt_recovery: True\n check_modules:\n check: False\n",
"module_name": "stages.iosxe.stages",
"package": "genie.libs.clean",
"tokens": {
"os": "iosxe"
},
"uid": "Reload",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L872"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L882"
}
},
"module_name": "stages.stages",
Expand All @@ -716,7 +716,7 @@
"os": "iosxe"
},
"uid": "ResetConfiguration",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2264"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L2337"
}
}
},
Expand Down Expand Up @@ -750,7 +750,7 @@
"os": "iosxe"
},
"uid": "RommonBoot",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1119"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1195"
}
}
},
Expand Down Expand Up @@ -899,7 +899,7 @@
"platform": "cat9k"
},
"uid": "VerifyAccessTunnelSummary",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L584"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L582"
}
},
"tokens": {
Expand Down Expand Up @@ -948,7 +948,7 @@
"platform": "cat9k"
},
"uid": "VerifyApFabricSummary",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L471"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L469"
}
},
"tokens": {
Expand Down Expand Up @@ -1074,7 +1074,7 @@
"platform": "cat9k"
},
"uid": "VerifyLispSessionEstablished",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L527"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L525"
}
},
"tokens": {
Expand All @@ -1096,7 +1096,7 @@
"platform": "cat9k"
},
"uid": "VerifyRunningImage",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L720"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L718"
}
},
"tokens": {
Expand Down Expand Up @@ -1131,7 +1131,7 @@
"platform": "cat9k"
},
"uid": "VerifyWirelessProcess",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L654"
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat9k/stages.py#L652"
}
},
"tokens": {
Expand Down
7 changes: 2 additions & 5 deletions pkgs/clean-pkg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re
import os

from setuptools import setup, find_packages
from setuptools import setup, find_packages, find_namespace_packages

def read(*paths):
'''read and return txt content of file'''
Expand Down Expand Up @@ -72,11 +72,8 @@ def find_version(*paths):
# project keywords
keywords = 'genie clean pyats cisco',

# uses namespace package
namespace_packages = ['genie', 'genie.libs'],

# project packages
packages = find_packages(where = 'src'),
packages = find_namespace_packages(where = 'src'),

# project directory
package_dir = {
Expand Down
1 change: 0 additions & 1 deletion pkgs/clean-pkg/src/genie/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion pkgs/clean-pkg/src/genie/libs/__init__.py

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.6'
__version__ = '24.7'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['[email protected]', '[email protected]']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
16 changes: 14 additions & 2 deletions pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@

# Unicon
from unicon.eal.dialogs import Statement, statement_decorator
from unicon.plugins.generic.statements import buffer_settled
from unicon.plugins.generic.statements import buffer_settled, enable_password_handler
from genie.libs.clean.recovery.dialogs import RommonDialog as TelnetDialog

# Genie
from genie.libs.clean.utils import print_message

log = logging.getLogger(__name__)


class BreakBootDialog(TelnetDialog):
'''Dialog to stop the device to boot at reload time'''

Expand Down Expand Up @@ -48,6 +47,19 @@ def __init__(self):
self.add_statement(Statement(pattern=r'^(Router|Switch|ios|switch|.+[^#])(\\(standby\\))?(\\(-stby)\\)?(\\(boot\\))?#$',
action=print_message,
args={'message': 'Device has reached privileged exec prompt'}))

# Press RETURN to get started
self.add_statement(Statement(pattern=r'^.*Press RETURN to get started.*',
action='sendline()',
loop_continue=True,
continue_timer=False))

# Password
self.add_statement(Statement(pattern=r'^.*Password:\s?$',
action=enable_password_handler,
args=None,
loop_continue=True,
continue_timer=False))


class RommonDialog(TelnetDialog):
Expand Down
Loading

0 comments on commit 1f781e0

Please sign in to comment.