theforeman / foreman_default_hostgroup

A plugin to set the default hostgroup when hosts are created.
GNU General Public License v3.0
11 stars 29 forks source link

Where is import_host_and_facts_without_match_hostgroup defined? #19

Closed otheus closed 8 years ago

otheus commented 8 years ago

This is a question not an issue. I'm attempting to modify the code for my own purposes, but I cannot get very far. This method import_host_and_facts_without_match_hostgroup had no definition anywhere inside the plugin, nor inside theforeman app nor the API. Is there a hidden dependency here?

domcleal commented 8 years ago

It's created by https://github.com/theforeman/foreman_default_hostgroup/blob/develop/lib/default_hostgroup_managed_host_patch.rb#L6.

It's a Rails way of extending a method - the "without" version is the original, defined in Foreman at https://github.com/theforeman/foreman/blob/c7d9169d12e16bcd5f4e3466e5cf99ca963eeea7/app/models/host/managed.rb#L467.

otheus commented 8 years ago

On Thu, Mar 24, 2016 at 10:56 AM, Dominic Cleal notifications@github.com wrote:

It's created by https://github.com/theforeman/foreman_default_hostgroup/blob/develop/lib/default_hostgroup_managed_host_patch.rb#L6. It's a Rails way of extending a method - the "without" version is the original, defined in Foreman at https://github.com/theforeman/foreman/blob/c7d9169d12e16bcd5f4e3466e5cf99ca963eeea7/app/models/host/managed.rb#L467 .

Thanks for the quick and helpful reply. I know and work with Ruby, but not at all with Rails. The similarities can be deceptive.

domcleal commented 8 years ago

No problem, feel free to call into #theforeman-dev on Freenode too if you've got questions.