Page MenuHomePhabricator

Improve Homer output when Juniper device rejects config
Closed, ResolvedPublic

Description

Creating this task as a reminder for me to go back and try to improve how Homer displays output when a generated configuration is rejected by a JunOS device.

The specific improvement is to try and see if the "context" of the error can be displayed by Homer if the config is rejected. For instance here is the Homer output when an invalid config is pushed (this is running from my laptop when working on new templates):

ERROR:homer.transports.junos:Commit check error on asw1-b12-drmrs.wikimedia.org: 
Fixed/BA Classifier or Rewrite allowed only on  Physical interface with family inet configured

When there has been a large diff it can be hard to know what part of the generated config is causing the error. Manually connecting to the device and adding the config (which is awkward due to needing set statements not what Homer generates), then doing "commit check" gives the context of the error:

cmooney@asw1-b12-drmrs# commit check 
[edit interfaces]
  'ge-0/0/0'
    Fixed/BA Classifier or Rewrite allowed only on  Physical interface with family inet configured
error: configuration check-out failed

If possible we should try to have Homer give this additional information (the "edit interfaces" context, as well as the "ge-0/0/0" reference) which would speed up development. A barrier may be the JunOS API, not sure if it actually returns that detail.

Event Timeline

cmooney created this task.

Change 947352 had a related patch set uploaded (by Ayounsi; author: Ayounsi):

[operations/software/homer@master] Junos: Add more info on commit errors

https://gerrit.wikimedia.org/r/947352

ayounsi moved this task from Backlog to This quarter on the netops board.

Change 947352 merged by jenkins-bot:

[operations/software/homer@master] Junos: Add more info on commit errors

https://gerrit.wikimedia.org/r/947352

Homer 0.6.4 released.