mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Convert nxos_vlan to DI module (#31866)
* Convert nxos_vlan to DI * fix conflict * push fix for qalthos's comment Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -123,13 +123,17 @@ class Cli:
|
||||
"""
|
||||
flags = [] if flags is None else flags
|
||||
|
||||
if self._device_configs != {}:
|
||||
return self._device_configs
|
||||
else:
|
||||
cmd = 'show running-config '
|
||||
cmd += ' '.join(flags)
|
||||
cmd = cmd.strip()
|
||||
|
||||
try:
|
||||
return self._device_configs[cmd]
|
||||
except KeyError:
|
||||
connection = self._get_connection()
|
||||
out = connection.get_config(flags=flags)
|
||||
cfg = to_text(out, errors='surrogate_then_replace').strip()
|
||||
self._device_configs = cfg
|
||||
self._device_configs[cmd] = cfg
|
||||
return cfg
|
||||
|
||||
def run_commands(self, commands, check_rc=True):
|
||||
|
||||
Reference in New Issue
Block a user