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

terminal regex udpate to match the terminal prompt in safe mode #134

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

therfert
Copy link
Contributor

SUMMARY

Updating the regex that matches the terminal prompt for command module in safe mode.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

command

ADDITIONAL INFORMATION

Commands are timing out in safe mode now, because the module will never match the terminal prompt which is required in order to recognize the end of the command output.

In order to try the functionality, CTRL + X (\x18) has to be passed as a command to the module.

@codecov
Copy link

codecov bot commented Nov 17, 2022

Codecov Report

Merging #134 (00537e8) into main (23b3aa3) will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
+ Coverage   87.31%   87.34%   +0.02%     
==========================================
  Files          28       28              
  Lines        3516     3516              
  Branches      626      626              
==========================================
+ Hits         3070     3071       +1     
  Misses        313      313              
+ Partials      133      132       -1     
Flag Coverage Δ
integration 66.86% <ø> (ø)
sanity 22.29% <ø> (ø)
units 87.38% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugins/terminal/routeros.py 66.66% <ø> (ø)
plugins/modules/api_info.py 83.09% <0.00%> (ø)
tests/unit/plugins/modules/test_api_info.py 100.00% <0.00%> (ø)
plugins/modules/api_modify.py 79.09% <0.00%> (+0.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Tomas Herfert added 2 commits November 17, 2022 18:00
Signed-off-by: Tomas Herfert <herfik>
Signed-off-by: Tomas Herfert <herfik>
@therfert therfert marked this pull request as ready for review November 17, 2022 17:34
@therfert
Copy link
Contributor Author

Hi @felixfontein, this should be the last PR from me for now, unless I find some other issue:)

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@felixfontein
Copy link
Collaborator

Hi @felixfontein, this should be the last PR from me for now, unless I find some other issue:)

I'll happily review more PRs if you have some :)

@github-actions
Copy link

github-actions bot commented Nov 17, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@benedikt-bartscher
Copy link

Hey @therfert thank you for this PR!
Could you give me a hint how to activate safe mode with ansible-routeros?

@fractalbrain
Copy link

Hi @benedikt-bartscher and @therfert! I'm also interested and getting safe-mode activated. @benedikt-bartscher, did you figure it out? I've been trying to pass '\x18' as a command, but I just get an empty string back and no indication of the safe mode prompt.

@benedikt-bartscher
Copy link

Hi @fractalbrain sadly i never got safe mode working. Maybe i will try it again next month, i need to install some MTK switches again.

@fractalbrain
Copy link

Hey @benedikt-bartscher ! Thanks for responding.

I haven't gotten it working yet either. It seems F4 also toggles safe mode, but I couldn't get the ANSI sequence for that to do anything. Just a blank line. I CAN use an ANSI sequence to clear the console (put '\1Bc').

Ah well. I'm having to resign myself to defeat for the moment.

@pertsevds
Copy link

pertsevds commented Nov 23, 2023

@benedikt-bartscher
@fractalbrain
Here is how you can enter the Safe mode:

- name: Go to Safe mode
  community.routeros.command:
    commands:
      - "\u0018"

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

Successfully merging this pull request may close these issues.

5 participants