Revision 0a64a09b
Added by Dominic Cleal about 9 years ago
app/models/hostgroup.rb | ||
---|---|---|
|
||
# no need to store anything in the db if the password is our default
|
||
def root_pass
|
||
read_attribute(:root_pass) || nested_root_pw || Setting[:root_pass]
|
||
return read_attribute(:root_pass) if read_attribute(:root_pass).present?
|
||
npw = nested_root_pw
|
||
return npw if npw.present?
|
||
Setting[:root_pass]
|
||
end
|
||
|
||
# Clone the hostgroup
|
Also available in: Unified diff
fixes #8739 - use global setting when hostgroup root_pass is blank
A blank (not nil) root_pass on hostgroups was preventing correct inheritance
from settings in both hosts and nested hostgroups.
root_pass was also being copied from parents/settings to hostgroups when they
were saved, when it should remain blank to continue inheriting. Only hosts
are meant to copy the password on save.
(cherry picked from commit db17629709a649bd49b83d60422b905c9db965be)