Skip to content

added support for config snippets#4

Merged
hellt merged 5 commits intomasterfrom
send-file
Aug 22, 2021
Merged

added support for config snippets#4
hellt merged 5 commits intomasterfrom
send-file

Conversation

@hellt
Copy link
Copy Markdown
Owner

@hellt hellt commented Jul 12, 2021

this PR adds support for

  • send-commands-from-file
  • send-configs
  • send-configs-from-file
    device-level options

The idea is to allow pushing some config to the devices before scrpaligo has cfg support.

/cc @carlmontanari

Comment thread commando/cmdo.go
return
// when sending configs we do not print any responses, as typically configs do not produce any output
if d.SendConfigsFromFile != "" {
_, err := driver.SendConfigsFromFile(d.SendConfigsFromFile)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be worth it to actual assign the response object and check the Failed attribute (err... method in the case of multi response since I dont know how to do something like a python property in go 😀 ) as this may indicate that the config itself failed from the device perspective -- even if everything "worked" from a scrapli perspective. the Failed attribute is governed by the FailedWhenContains slice of strings -- if we see any of those substrings in the returned output (stuff like "% invalid input" and the like).

@hellt hellt closed this Aug 22, 2021
@hellt hellt reopened this Aug 22, 2021
@hellt hellt merged commit e0a90f8 into master Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants