diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py index 31b4803d8bb..7cc8dcaa4b5 100644 --- a/lib/ansible/module_utils/eos.py +++ b/lib/ansible/module_utils/eos.py @@ -125,12 +125,6 @@ class Cli: command = self._module.jsonify(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): """Retrieves the current config from the device or cache """ @@ -193,9 +187,6 @@ class Cli: def configure(self, commands): """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) rc, out, err = self.exec_command('configure') @@ -212,9 +203,6 @@ class Cli: def load_config(self, commands, commit=False, replace=False): """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) try: use_session = int(use_session)