Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nokia SR Linux: Modify check_config_mode regex #3240

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions netmiko/nokia/nokia_srl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def config_mode(

def check_config_mode(
self,
check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* )candidate",
check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* | \+\! )candidate",
pattern: str = r"#",
force_regex: bool = True,
) -> bool:
Expand Down Expand Up @@ -161,5 +161,7 @@ def _has_uncommitted_changes(self, prompt: str) -> bool:
The exclamation mark (!) in the prompt indicates that another user has commited
changes to the running datastore.
"""
matches = re.search(r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* )candidate", prompt)
matches = re.search(
r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* | \+\! )candidate", prompt
)
return True if matches and "*" in matches.group() else False
1 change: 1 addition & 0 deletions tests/etc/test_devices.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ nokia_srl:
ip: clab-srltest-srl1
username: admin
password: 'admin'
use_keys: "True"

audiocode_72:
device_type: audiocode_72
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nokia_srl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The containerlab node hostname is clab-srltest-srl1.
## Run the test

```
sudo sh test_srl.sh
./test_srl.sh
```

## Destroy containerlab Node
Expand Down
4 changes: 2 additions & 2 deletions tests/test_nokia_srl/test_srl.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ RETURN_CODE=0
echo "Starting tests...:" \
&& echo "Nokia SR Linux" \
&& cd .. \
&& py.test -s -x -v test_netmiko_show.py --test_device nokia_srl \
&& py.test -s -x -v test_netmiko_config.py --test_device nokia_srl \
&& pytest -s -x -v test_netmiko_show.py --test_device nokia_srl \
&& pytest -s -x -v test_netmiko_config.py --test_device nokia_srl \
|| RETURN_CODE=1

exit $RETURN_CODE
Loading