Open hakong opened 10 years ago
Should this be closed, or is there anything to be done about this? Would be really nice if Adagios/Pynag would update attribute values that reference something that was just renamed, like... super nice :)
If I remember correctly, me and @palli discussed this and he didn't want to do anything about this because of reasons I don't remember
I'm quite sure this has to do with changing contact_name and updating all objects which refer to this contact object. Considering the following:
define contact {
use generic-contact
contact_name thedude
}
define contactgroup {
contactgroup_name dudes
alias a group of dudes
members thedude
}
define contact {
use generic-contact
contact_name thefoo
}
define contactgroup {
contactgroup_name dudes
alias a group of dudes
members thedude
}
Here the "clever" thing would be to find all references to the contact in all object types that support it and update, which is not how it is today.
So the question is in my mind, should "Configure" be this clever or not? If so for consistency all object types would have to be reviewed and work in the same manner.
@palli if you have any comments, that would be super.
This is not trivial to implement because there are very many edge cases to consider.
This can be done after the underlying config changes required are implemented, there is already progress on this via pynag.Model.*.rename() methods which can facilitate for this.
However they are not all complete, i.e. host is done, but contact is not.
Any takers on implementing rename() for all object types ?
Reproduced in 2 adagios installs with 2 contacts. Steps to reproduce: Configure > Contacts > select a contact > change Contact Name -> Save -> Reload -> Warning! Error: Could not find any contact matching 'new contact name' (config file '/etc/nagios/okconfig/contactgroups/host.com.cfg', starting on line 5)