Skip to content

Commit 3f86be3

Browse files
authored
Merge pull request #102 from CiscoTestAutomation/release_24.7
release_24.7
2 parents 46cdcc1 + 1adae75 commit 3f86be3

File tree

14 files changed

+195
-2
lines changed

14 files changed

+195
-2
lines changed

docs/changelog/2024/july.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
July 2024
2+
==========
3+
4+
July 30 - Unicon v24.7
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v24.7
13+
``unicon``, v24.7
14+
15+
Install Instructions
16+
^^^^^^^^^^^^^^^^^^^^
17+
18+
.. code-block:: bash
19+
20+
bash$ pip install unicon.plugins
21+
bash$ pip install unicon
22+
23+
Upgrade Instructions
24+
^^^^^^^^^^^^^^^^^^^^
25+
26+
.. code-block:: bash
27+
28+
bash$ pip install --upgrade unicon.plugins
29+
bash$ pip install --upgrade unicon
30+
31+
Features and Bug Fixes:
32+
^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
35+
36+
37+
Changelogs
38+
^^^^^^^^^^
39+
--------------------------------------------------------------------------------
40+
Fix
41+
--------------------------------------------------------------------------------
42+
43+
* generic
44+
* Updated with `sleep_time` to handle the copy command
45+
46+

docs/changelog/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2024/july
78
2024/june
89
2024/may
910
2024/april
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
July 2024
2+
==========
3+
4+
July 30 - Unicon.Plugins v24.7
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v24.7
13+
``unicon``, v24.7
14+
15+
Install Instructions
16+
^^^^^^^^^^^^^^^^^^^^
17+
18+
.. code-block:: bash
19+
20+
bash$ pip install unicon.plugins
21+
bash$ pip install unicon
22+
23+
Upgrade Instructions
24+
^^^^^^^^^^^^^^^^^^^^
25+
26+
.. code-block:: bash
27+
28+
bash$ pip install --upgrade unicon.plugins
29+
bash$ pip install --upgrade unicon
30+
31+
Features and Bug Fixes:
32+
^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
35+
36+
37+
Changelogs
38+
^^^^^^^^^^
39+
--------------------------------------------------------------------------------
40+
Fix
41+
--------------------------------------------------------------------------------
42+
43+
* iosxe
44+
* add "disable_selinux" parameter to bash_console service, to automatically
45+
46+

docs/changelog_plugins/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Plugins Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2024/july
78
2024/june
89
2024/may
910
2024/april

src/unicon/plugins/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '24.6'
1+
__version__ = '24.7'
22

33
supported_chassis = [
44
'single_rp',

src/unicon/plugins/generic/service_implementation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import collections
2121
import ipaddress
2222
from itertools import chain
23+
import time
2324
import warnings
2425
from datetime import datetime, timedelta
2526

@@ -1666,6 +1667,9 @@ def call_service(self, reply=Dialog([]), *args, **kwargs): # noqa: C901
16661667
for retry_num in range(self.max_attempts):
16671668
spawn.sendline(copy_string)
16681669
try:
1670+
if (sleep_time := kwargs.get('sleep_time')):
1671+
con.log.info(f"sleep for {sleep_time} seconds")
1672+
time.sleep(sleep_time)
16691673
self.result = dialog.process(spawn,
16701674
context=copy_context,
16711675
timeout=timeout)

src/unicon/plugins/iosxe/cat9k/c9800cl/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
from unicon.plugins.iosxe.cat9k.c9800 import IosXEc9800ServiceList, IosXEc9800SingleRpConnection, IosXEc9800DualRPConnection
3-
3+
from unicon.plugins.iosxe import service_implementation as svc
44

55
class IosXEc9800CLServiceList(IosXEc9800ServiceList):
66
def __init__(self):
77
super().__init__()
8+
self.rommon = svc.Rommon
89

910

1011

src/unicon/plugins/iosxe/service_implementation.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ def pre_service(self, *args, **kwargs):
165165
handle.context['_chassis'] = kwargs.get('chassis')
166166
else:
167167
handle.context.pop('_chassis', None)
168+
if kwargs.get('disable_selinux') is not None:
169+
handle.context['_disable_selinux'] = kwargs.get('disable_selinux')
170+
elif hasattr(self, 'disable_selinux'):
171+
handle.context['_disable_selinux'] = self.disable_selinux
172+
else:
173+
handle.context.pop('_disable_selinux', None)
168174
super().pre_service(*args, **kwargs)
169175

170176
class ContextMgr(GenericBashService.ContextMgr):
@@ -176,6 +182,12 @@ def __init__(self, connection, enable_bash=False, timeout=None, **kwargs):
176182

177183
def __enter__(self):
178184

185+
if self.conn.context.get('_disable_selinux'):
186+
try:
187+
self.conn.execute('set platform software selinux permissive')
188+
except SubCommandFailure:
189+
pass
190+
179191
self.conn.log.debug('+++ attaching bash shell +++')
180192
# enter shell prompt
181193
self.conn.state_machine.go_to(
@@ -190,6 +202,16 @@ def __enter__(self):
190202

191203
return self
192204

205+
def __exit__(self, type, value, traceback):
206+
res = super().__exit__(type, value, traceback)
207+
208+
if self.conn.context.get('_disable_selinux'):
209+
try:
210+
self.conn.execute('set platform software selinux default')
211+
except SubCommandFailure:
212+
pass
213+
214+
return res
193215

194216
class ResetStandbyRP(GenericResetStandbyRP):
195217
""" Service to reset the standby rp.

src/unicon/plugins/tests/mock_data/ios/ios_mock_copy.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,18 @@ wait_for_recovery:
7070
new_state: enable
7171
response: |
7272
sending keyboard interrupt
73+
74+
copy_src_bootflash:
75+
prompt: "Source filename []? "
76+
commands:
77+
"/c8000aep-universalk9.17.12.04.0.4708.SSA.bin":
78+
new_state: dest_file_name
79+
80+
dest_file_name:
81+
prompt: "Destination filename [c8000aep-universalk9.17.12.04.0.4708.SSA.bin]? "
82+
commands:
83+
"test/c8000aep-universalk9.17.12.04.0.4708.SSA.bin":
84+
new_state: enable
85+
response: |
86+
Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
87+
787557605 bytes copied in 71.982 secs (10941035 bytes/sec)

src/unicon/plugins/tests/mock_data/ios/ios_mock_data.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ enable:
341341
new_state: exec_standby
342342
"redundancy switch-activity force":
343343
new_state: confirm_switch_activity
344+
"copy bootflash: usb:":
345+
new_state: copy_src_bootflash
344346
"copy flash: flash-3:":
345347
new_state: copy_src
346348
"copy tftp: bootflash:":

0 commit comments

Comments
 (0)