Fix eos call to prompt() (#32985)
* Remove the check entirely The response tells you to authorize anyway
This commit is contained in:
parent
212d96f779
commit
c1c0ad5d69
1 changed files with 0 additions and 12 deletions
|
@ -125,12 +125,6 @@ class Cli:
|
||||||
command = self._module.jsonify(command)
|
command = self._module.jsonify(command)
|
||||||
return exec_command(self._module, command)
|
return exec_command(self._module, command)
|
||||||
|
|
||||||
def check_authorization(self):
|
|
||||||
for cmd in ['show clock', 'prompt()']:
|
|
||||||
rc, out, err = self.exec_command(cmd)
|
|
||||||
out = to_text(out, errors='surrogate_then_replace')
|
|
||||||
return out.endswith('#')
|
|
||||||
|
|
||||||
def get_config(self, flags=None):
|
def get_config(self, flags=None):
|
||||||
"""Retrieves the current config from the device or cache
|
"""Retrieves the current config from the device or cache
|
||||||
"""
|
"""
|
||||||
|
@ -193,9 +187,6 @@ class Cli:
|
||||||
def configure(self, commands):
|
def configure(self, commands):
|
||||||
"""Sends configuration commands to the remote device
|
"""Sends configuration commands to the remote device
|
||||||
"""
|
"""
|
||||||
if not self.check_authorization():
|
|
||||||
self._module.fail_json(msg='configuration operations require privilege escalation')
|
|
||||||
|
|
||||||
conn = get_connection(self)
|
conn = get_connection(self)
|
||||||
|
|
||||||
rc, out, err = self.exec_command('configure')
|
rc, out, err = self.exec_command('configure')
|
||||||
|
@ -212,9 +203,6 @@ class Cli:
|
||||||
def load_config(self, commands, commit=False, replace=False):
|
def load_config(self, commands, commit=False, replace=False):
|
||||||
"""Loads the config commands onto the remote device
|
"""Loads the config commands onto the remote device
|
||||||
"""
|
"""
|
||||||
if not self.check_authorization():
|
|
||||||
self._module.fail_json(msg='configuration operations require privilege escalation')
|
|
||||||
|
|
||||||
use_session = os.getenv('ANSIBLE_EOS_USE_SESSIONS', True)
|
use_session = os.getenv('ANSIBLE_EOS_USE_SESSIONS', True)
|
||||||
try:
|
try:
|
||||||
use_session = int(use_session)
|
use_session = int(use_session)
|
||||||
|
|
Loading…
Reference in a new issue