napalm-automation-community / napalm-vyos

NAPALM Driver for the VyOS
Apache License 2.0
38 stars 27 forks source link

Show errors from commit failure #48

Open yzguy opened 1 year ago

yzguy commented 1 year ago

Fixes #47

Capture the errors from Netmiko and show them to the user

Before:

TASK [Apply Configuration] **********************************************
fatal: [dev]: FAILED! => changed=false 
  msg: 'cannot install config: Failed to commit config on the device'

After:

TASK [Apply Configuration] ************************************************
fatal: [dev]: FAILED! => changed=false 
  msg: |-
    cannot install config:

    Commit failed with following errors:

    commit
    [ interfaces l2tpv3 l2tpeth1 address 192.168.1/30 ]
    Error: 192.168.1/30 is not a valid IP host

    [ interfaces l2tpv3 l2tpeth1 address 192.168.1/30 ]
    Invalid value

    [[interfaces l2tpv3 l2tpeth1]] failed
    Commit failed
    [edit]