mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Disable CLI errors when typing enable (#18531)
This commit is contained in:
parent
40ddbe026d
commit
05e5474c52
1 changed files with 5 additions and 0 deletions
|
@ -62,8 +62,13 @@ class Cli(CliBase):
|
||||||
|
|
||||||
def authorize(self, params, **kwargs):
|
def authorize(self, params, **kwargs):
|
||||||
passwd = params['auth_pass']
|
passwd = params['auth_pass']
|
||||||
|
errors = self.shell.errors
|
||||||
|
# Disable errors (if already in enable mode)
|
||||||
|
self.shell.errors = []
|
||||||
cmd = Command('enable', prompt=self.NET_PASSWD_RE, response=passwd)
|
cmd = Command('enable', prompt=self.NET_PASSWD_RE, response=passwd)
|
||||||
self.execute([cmd, 'no terminal pager'])
|
self.execute([cmd, 'no terminal pager'])
|
||||||
|
# Reapply error handling
|
||||||
|
self.shell.errors = errors
|
||||||
|
|
||||||
def change_context(self, params):
|
def change_context(self, params):
|
||||||
context = params['context']
|
context = params['context']
|
||||||
|
|
Loading…
Reference in a new issue