summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/fileparsing.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-11 07:40:16 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-11 07:40:16 +0000
commit0643113a7a8127ce559aa0cce0b81df5e99d386c (patch)
tree15e693db02840a656ed8b43027fcb55d257d7c8c /lib/puppet/util/fileparsing.rb
parent7c8614b0589f7c843d17b9d16720419817394cee (diff)
downloadpuppet-0643113a7a8127ce559aa0cce0b81df5e99d386c.tar.gz
puppet-0643113a7a8127ce559aa0cce0b81df5e99d386c.tar.xz
puppet-0643113a7a8127ce559aa0cce0b81df5e99d386c.zip
An intermediate commit. All of the classes that use parsedfile are assuredly broken, since I have basically completely rewritten it. These classes have been a thorn in my side almost since I created them, yet they have been significantly less functional that I wanted. So, I decided to do the rewrite I have been putting off, just to spend all of the maintenance time now so I do not spend 3 days on them every release.
Tomorrow I will be porting all of the existing types (including cron, hopefully) over to this new base. This will also make it possible to add other types of providers to these classes; we should be able to reuse the netinfo provider for os x types, and we should be able to create a cron provider that writes to /etc/crontab instead of user crontabs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1856 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/util/fileparsing.rb')
-rw-r--r--lib/puppet/util/fileparsing.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/puppet/util/fileparsing.rb b/lib/puppet/util/fileparsing.rb
index e4998cf7e..705192b11 100644
--- a/lib/puppet/util/fileparsing.rb
+++ b/lib/puppet/util/fileparsing.rb
@@ -108,10 +108,11 @@ module Puppet::Util::FileParsing
raise ArgumentError, "Must include a list of fields"
end
+ invalidfields = [:record_type, :target, :on_disk]
options[:fields] = options[:fields].collect do |field|
r = symbolize(field)
- if r == :record_type
- raise ArgumentError.new("Cannot have fields named record_type")
+ if invalidfields.include?(r)
+ raise ArgumentError.new("Cannot have fields named %s" % r)
end
r
end