Project

General

Profile

Bug #20109

Kafo can search the same path multiple times resulting in attempted duplicate registrations

Added by Neil Hanlon about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
trivial
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

While adding a custom type definition to the puppet-certs module, I found the module was failing to run with the following stack:

/usr/share/gems/gems/kafo-2.0.0/lib/kafo/data_type.rb:30:in `register_type': Data type Certs::Relativeunixpath is already registered, cannot be re-registered (ArgumentError)
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/data_type_parser.rb:24:in `block in register'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/data_type_parser.rb:22:in `each'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/data_type_parser.rb:22:in `register'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:344:in `block (2 levels) in register_data_types'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:343:in `each'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:343:in `block in register_data_types'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:341:in `each'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:341:in `register_data_types'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:96:in `modules'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:207:in `params'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/configuration.rb:217:in `preset_defaults_from_puppet'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/kafo_configure.rb:285:in `set_parameters'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/kafo_configure.rb:100:in `initialize'
    from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `new'
    from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    from /usr/share/gems/gems/kafo-2.0.0/lib/kafo/kafo_configure.rb:163:in `run'
    from /usr/sbin/foreman-proxy-certs-generate:85:in `<main>'

Through some more debugging, it turns out if the kafo configuration has the same path in both :module_dirs: and :installer_dir:, it can try to add both of these to the `module_dirs` in kafo/configuration.rb.

Relates to: http://projects.theforeman.org/issues/19578

Associated revisions

Revision c2d02043 (diff)
Added by Neil Hanlon about 5 years ago

Fixes #20109 - Make module_dirs allways uniq

Call uniq on this array to avoid duplicates

History

#1 Updated by Neil Hanlon about 5 years ago

  • Pull request https://github.com/theforeman/kafo/pull/216 added

#2 Updated by The Foreman Bot about 5 years ago

  • Status changed from New to Ready For Testing

#3 Updated by Neil Hanlon about 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF