Project

General

Profile

« Previous | Next » 

Revision 76607ed5

Added by Ohad Levy almost 13 years ago

  • ID 76607ed5fc692646c4b31791eea9c71a903e8f17

fixes #100 - Setting is now a ActiveRecord object

This allows users to manage foreman settings via the UI.

the UI is a bit ugly, but works :)

View differences:

app/models/host_common.rb
if puppetca?
SmartProxy.find(read_attribute(:puppetproxy_id))
else
read_attribute(:puppetmaster_name) || SETTINGS[:puppet_server] || "puppet"
read_attribute(:puppetmaster_name) || Setting[:puppet_server]
end
end
......
if puppetca?
write_attribute(:puppetproxy_id, pm.id)
else
write_attribute(:puppetmaster_name, pm == (SETTINGS[:puppet_server] || "puppet") ? nil : pm)
write_attribute(:puppetmaster_name, pm == (Setting[:puppet_server]) ? nil : pm)
end
end
# no need to store anything in the db if the password is our default
def root_pass
read_attribute(:root_pass) || SETTINGS[:root_pass] || "!*!*!*!*!"
read_attribute(:root_pass) || Setting[:root_pass]
end
# If the host/hostgroup has a medium then use the path from there

Also available in: Unified diff