Open jeffkala opened 1 year ago
Perhaps we should move this as a class attribute, so:
Would become
class NautobotNornirDriver(DefaultNautobotNornirDriver):
"""Collection of Nornir Tasks specific to Juniper Junos devices."""
run_command = 'show configuration | display set'
and then update
@staticmethod
def get_config(task: Task, logger, obj, backup_file: str, remove_lines: list, substitute_lines: list) -> Result:
"""
logger.log_debug(f"Executing get_config for {task.host.name} on {task.host.platform}")
command = self.run_command
This would allow us to address issues we are seeing in ruckus as well.
Makes sense if I'm picking up what is being stated right.
Seems like some interop with using platform_slug_map from golden config and overloading a platform from that map in the dispatcher.
GC user has platform map of:
And dispatcher point to netmiko juniper_junos
Issue:
with dispatcher_mapping set to
juniper_junos
getting:if setting the dispatcher_mapping to
junos
getting:While debugging this is because its pulling back command to run based on default key which is
show run
.Workaround is to update:
https://github.com/nautobot/nornir-nautobot/blob/bb977910f9e711fe2190a71d61b641f277e73b80/nornir_nautobot/plugins/tasks/dispatcher/default.py#LL29C1-L37C2
and in this case add a
junos
key.