diff options
author | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-09 18:57:01 +0000 |
---|---|---|
committer | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-09 18:57:01 +0000 |
commit | cf166c25911f521cdf12178ebbe0b39f81473b35 (patch) | |
tree | 1a96094de1203cb3d48b6c07255414bea351092a /lib/puppet/parser/resource.rb | |
parent | 28c283c73388c3f76e1d715c41ebd82ac35ca9a4 (diff) | |
download | puppet-cf166c25911f521cdf12178ebbe0b39f81473b35.tar.gz puppet-cf166c25911f521cdf12178ebbe0b39f81473b35.tar.xz puppet-cf166c25911f521cdf12178ebbe0b39f81473b35.zip |
Rails stuff part 1
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1837 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/resource.rb')
-rw-r--r-- | lib/puppet/parser/resource.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index af5d10501..d27c8b27e 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -252,27 +252,25 @@ class Puppet::Parser::Resource # with. def store(host) args = {} - %w{type title tags file line exported}.each do |param| + #FIXME: support files/lines, etc. + #%w{type title tags file line exported}.each do |param| + %w{type title tags exported}.each do |param| if value = self.send(param) args[param] = value end end - # 'type' isn't a valid column name, so we have to use something else. args = symbolize_options(args) - args[:restype] = args[:type] - args.delete(:type) # Let's see if the object exists - #if obj = host.rails_resources.find_by_type_and_title(self.type, self.title) - if obj = host.rails_resources.find_by_restype_and_title(self.type, self.title) + if obj = host.resources.find_by_type_and_title(self.type, self.title) # We exist args.each do |param, value| obj[param] = value end else # Else create it anew - obj = host.rails_resources.build(args) + obj = host.resources.build(args) end # Either way, now add our parameters |