diff options
| author | Luke Kanies <luke@madstop.com> | 2009-01-28 12:39:09 -0600 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-02-06 21:28:42 +1100 |
| commit | 10bf15103874b75775bdfe573029caf8a38468d0 (patch) | |
| tree | bd39430189b9d3172b9b14603050dccf25ae3cae /lib/puppet/parser/resource.rb | |
| parent | 500ea2020f95f8e96663f4a56d43be62819ef929 (diff) | |
| download | puppet-10bf15103874b75775bdfe573029caf8a38468d0.tar.gz puppet-10bf15103874b75775bdfe573029caf8a38468d0.tar.xz puppet-10bf15103874b75775bdfe573029caf8a38468d0.zip | |
Fixing #1913 - 'undef' resource values do not get copied to the db
There are unfortunately no tests for this patch; the Rails
code is disappointingly low on tests as it is, and it would
have been essentially an herculian effort add all of the necessary
tests just to make sure this worked.
I've verified it works in practice, which should be sufficient for now.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser/resource.rb')
| -rw-r--r-- | lib/puppet/parser/resource.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index fef0b54ca..92a90d871 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -176,7 +176,7 @@ class Puppet::Parser::Resource db_resource.file = self.file end - updated_params = @params.inject({}) do |hash, ary| + updated_params = @params.reject { |name, param| param.value == :undef }.inject({}) do |hash, ary| hash[ary[0].to_s] = ary[1] hash end @@ -270,6 +270,7 @@ class Puppet::Parser::Resource db_resource.save @params.each { |name, param| + next if param.value == :undef param.to_rails(db_resource) } |
