Skip to content

Commit

Permalink
bump pytest-asyncio, fix save cfg on iosxe when file prompt mode chan…
Browse files Browse the repository at this point in the history
…ges, bump another pre release
  • Loading branch information
carlmontanari committed Apr 22, 2021
1 parent 8783dc5 commit e47a451
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pydocstyle==6.0.0
pyfakefs==4.4.0
pylama==7.7.1
pylint==2.7.4
pytest-asyncio==0.14.0
pytest-asyncio==0.15.0
pytest-cov==2.11.1
pytest==6.2.3
scrapli-replay==2021.7.30a4
Expand Down
11 changes: 5 additions & 6 deletions scrapli_cfg/platform/core/cisco_iosxe/async_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@ async def abort_config(self) -> ScrapliCfgResponse:

return self._post_abort_config(response=response, scrapli_responses=[abort_result])

async def save_config(self, file_prompt_mode: Optional[FilePromptMode] = None) -> Response:
async def save_config(self) -> Response:
"""
Save the config -- "copy run start"!
Args:
file_prompt_mode: optionally provide the file prompt mode, if its None we will fetch it
to decide if we need to use interactive mode or not
N/A
Returns:
Response: scrapli response object
Expand All @@ -243,8 +242,8 @@ async def save_config(self, file_prompt_mode: Optional[FilePromptMode] = None) -
N/A
"""
if file_prompt_mode is None:
file_prompt_mode = await self._determine_file_prompt_mode()
# we always re-check file prompt mode because it could have changed!
file_prompt_mode = await self._determine_file_prompt_mode()

if file_prompt_mode == FilePromptMode.ALERT:
save_events = [
Expand Down Expand Up @@ -338,7 +337,7 @@ async def commit_config(self, source: str = "running") -> ScrapliCfgResponse:

scrapli_responses.append(commit_result)

save_config_result = await self.save_config(file_prompt_mode=file_prompt_mode)
save_config_result = await self.save_config()
scrapli_responses.append(save_config_result)

if self.cleanup_post_commit:
Expand Down
11 changes: 5 additions & 6 deletions scrapli_cfg/platform/core/cisco_iosxe/sync_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,12 @@ def abort_config(self) -> ScrapliCfgResponse:

return self._post_abort_config(response=response, scrapli_responses=[abort_result])

def save_config(self, file_prompt_mode: Optional[FilePromptMode] = None) -> Response:
def save_config(self) -> Response:
"""
Save the config -- "copy run start"!
Args:
file_prompt_mode: optionally provide the file prompt mode, if its None we will fetch it
to decide if we need to use interactive mode or not
N/A
Returns:
Response: scrapli response object
Expand All @@ -242,8 +241,8 @@ def save_config(self, file_prompt_mode: Optional[FilePromptMode] = None) -> Resp
N/A
"""
if file_prompt_mode is None:
file_prompt_mode = self._determine_file_prompt_mode()
# we always re-check file prompt mode because it could have changed!
file_prompt_mode = self._determine_file_prompt_mode()

if file_prompt_mode == FilePromptMode.ALERT:
save_events = [
Expand Down Expand Up @@ -335,7 +334,7 @@ def commit_config(self, source: str = "running") -> ScrapliCfgResponse:

scrapli_responses.append(commit_result)

save_config_result = self.save_config(file_prompt_mode=file_prompt_mode)
save_config_result = self.save_config()
scrapli_responses.append(save_config_result)

if self.cleanup_post_commit:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import setuptools

__version__ = "2021.07.30a6"
__version__ = "2021.07.30a7"
__author__ = "Carl Montanari"

with open("README.md", "r", encoding="utf-8") as f:
Expand Down

0 comments on commit e47a451

Please sign in to comment.