Project

General

Profile

Actions

Bug #20109

closed

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

Added by Neil Hanlon over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
trivial
Triaged:
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

Actions

Also available in: Atom PDF