Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5616

puppet device convergence impossibility, and improved error output

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.1
    • Fix Version/s: PUP 4.5.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2016-04-20
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      With puppet device, one could declare a resource which would never converge. In addition, some underlying errors were caught and not shown to the user. Both are fixed here.

      Description

      In testing I found that error display was (and has always been) suboptimal, so I have a PR which improves this. First, some errors were never caught and shown to the user

      Notice: /Stage[main]/Device_hiera::Interfaces/Interface[FastEthernet0/14]/mode: mode changed 'access' to 'trunk'
      Debug: Updating interface FastEthernet0/14
      Debug: ssh: send conf t
      Debug: ssh: expected conf t
      Enter configuration commands, one per line.  End with CNTL/Z.
      switch01(config)#
      Debug: ssh: send interface FastEthernet0/14
      Debug: ssh: expected interface FastEthernet0/14
      switch01(config-if)#
      Debug: ssh: send switchport mode trunk
      Debug: ssh: expected switchport mode trunk
      Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
      

      When an error was output, it repeated the command sent twice:

      Notice: /Stage[main]/Device_hiera::Interfaces/Interface[FastEthernet0/14]/mode: mode changed 'trunk' to 'access'
      Error: Error while executing switchport trunk encapsulation negotiate, device returned switchport trunk encapsulation negotiate
      Command rejected: A port which is configured to "trunk" mode can not be configured to negotiate the encapsulation.
      switch01(config-if)#
      

      I also found that due to the state parser dropping some input values, one could declare a resource which would never convergence, causing it to be output every time.

      $ puppet device --verbose
      Info: starting applying configuration to switch01.example.com at ssh://switch01.example.com/
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Caching catalog for switch01.example.com
      Info: Applying configuration version '1450262463'
      Notice: /Stage[main]/Device_hiera::Interfaces/Interface[FastEthernet0/12]/native_vlan: defined 'native_vlan' as '200'
      Info: Class[Device_hiera::Interfaces]: Unscheduling all events on Class[Device_hiera::Interfaces]
      Notice: Applied catalog in 74.54 seconds
       
      $ puppet device --verbose
      Info: starting applying configuration to switch01.example.com at ssh://switch01.example.com/
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Caching catalog for switch01.example.com
      Info: Applying configuration version '1450262647'
      Notice: /Stage[main]/Device_hiera::Interfaces/Interface[FastEthernet0/12]/native_vlan: defined 'native_vlan' as '200'
      

      The PR I will link to this issue fixes all of these things.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  jorhett Jo Rhett
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: