Commands

nornir.plugins.tasks.commands.command(task: nornir.core.task.Task, command: str) → nornir.core.task.Result

Executes a command locally

Parameters:command – command to execute
Returns:
  • result (str): stderr or stdout
  • stdout (str): stdout
  • stderr (str): stderr
Return type:Result object with the following attributes set
Raises:nornir.core.exceptions.CommandError – when there is a command error
nornir.plugins.tasks.commands.remote_command(task: nornir.core.task.Task, command: str) → nornir.core.task.Result

Executes a command remotely on the host

Parameters:command (str) – command to execute
Returns:
  • result (str): stderr or stdout
  • stdout (str): stdout
  • stderr (str): stderr
Return type:Result object with the following attributes set
Raises:nornir.core.exceptions.CommandError – when there is a command error