napalm-automation / napalm-ios

Apache License 2.0
31 stars 40 forks source link

Capture generic errors when doing a commit/replace #150

Closed dbarrosop closed 7 years ago

dbarrosop commented 7 years ago

I realized that some generic errors like this one weren't being captured:

    cannot install config: Candidate config could not be applied
    Error: received error code 5 when looking for missing lines

    The rollback configlet from the last pass is listed below:
    ********
    !List of Rollback Commands:
    no end
    interface GigabitEthernet3
     no ipv6 address 2001:DB8:CAF3:2::1/64
     no negotiation auto
     no description Link2;
    interface GigabitEthernet2
     no ipv6 address 2001:DB8:CAF3:1::1/64
     no negotiation auto
     no description Link1;
    interface Loopback0
     no ipv6 address 2001:DB8:B33F::101/128
     no description Loopback interface;
    no username hacker nopassword
    archive
     no write-memory
     no path bootflash:archive
    no boot-end-marker

    no boot-start-marker

    archive
      path bootflash:archive
      write-memory
    interface Loopback0
      description Loopback interface;
      ipv6 address 2001:DB8:B33F::101/128
      no shutdown
    interface GigabitEthernet2
      description Link1;
      ipv6 address 2001:DB8:CAF3:1::1/64
      no shutdown
    ********

    Rollback aborted after 1 passes

What that error actually means or why it's triggered I don't know. It also appends the error to the exception message.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.03%) to 67.453% when pulling 841e9af909f9072d731ada91e24e0cb8c2aff598 on dbarrosop/commit_replace_error into dcd0ade538eab448c116664339d107bf16c578ec on develop.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.03%) to 67.453% when pulling 841e9af909f9072d731ada91e24e0cb8c2aff598 on dbarrosop/commit_replace_error into dcd0ade538eab448c116664339d107bf16c578ec on develop.