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

unicon HVRP self.config_prompt wrong regex #183

Closed
jibo78 opened this issue Sep 29, 2022 · 2 comments
Closed

unicon HVRP self.config_prompt wrong regex #183

jibo78 opened this issue Sep 29, 2022 · 2 comments
Assignees

Comments

@jibo78
Copy link

jibo78 commented Sep 29, 2022

There is a regex mistake for hvrp's unicon patterns.py file

Path: myvenv/lib/python3.8/site-packages/unicon/plugins/hvrp/patterns.py
$ character is missing at the end of the regex self.config_prompt

        self.config_prompt = r'^\[.*\]'

We have an error when we try to configure a Huawei N8000 device with pyATS

In [3]: device.configure(['interface GigabitEthernet0/7/2','shutdown'])

2022-09-29 14:46:16,117: %UNICON-INFO: +++  with via 'cli': config +++
system-view
Enter system view, return user view with return command.
[~N1-NE8000-PEAG-1]
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)

TimeoutError: timeout occurred:
              timeout value: 30
              last_command: 'system-view\r'
             pattern: ['^\\[.*\\]']
             buffer:'system-view\r\nEnter system view, return user view with return command.\r\n[~N1-NE8000-PEAG-1]'

If we add $, it works

        self.config_prompt = r'^\[.*\]$'
In [6]: device.configure(['interface GigabitEthernet0/7/2','shutdown'])

2022-09-29 14:29:03,854: %UNICON-INFO: +++  with via 'cli': config +++
system-view
Enter system view, return user view with return command.
[~N1-NE8000-PEAG-1]interface GigabitEthernet0/7/2
[~N1-NE8000-PEAG-1-GigabitEthernet0/7/2]shutdown
[*N1-NE8000-PEAG-1-GigabitEthernet0/7/2]commit
[~N1-NE8000-PEAG-1-GigabitEthernet0/7/2]return
<N1-NE8000-PEAG-1>
@Taarini Taarini self-assigned this Sep 29, 2022
@Taarini
Copy link
Contributor

Taarini commented Sep 29, 2022

Hi

Thanks for reporting.

Please consider contributing to the library.

Can you please create a PR to fix the issue.

Let me know if you create one, so that i can assist you with the approval

@jibo78
Copy link
Author

jibo78 commented Sep 30, 2022

Hi Taarini,

I moved this issue to unicon repo:
CiscoTestAutomation/unicon.plugins#65

I will try to do a RP

Thanks for you help

@jibo78 jibo78 closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants