summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-03-26 16:55:10 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit76274413ded0c9260532984eb9484c6db9e186cf (patch)
treeb0a886aa3da9a3f275e2d4682c401441b15de314 /lib
parent9d9b20f4e6d4bd3501033d58b0e93411e40a147a (diff)
downloadpuppet-76274413ded0c9260532984eb9484c6db9e186cf.tar.gz
puppet-76274413ded0c9260532984eb9484c6db9e186cf.tar.xz
puppet-76274413ded0c9260532984eb9484c6db9e186cf.zip
Fixing most failing test/ tests.
This is mostly just adjusting existing tests to meet new APIs, but it's a small amount of fixing the code to meet new standards and an even smaller amount of porting code over. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/exec.rb6
-rwxr-xr-xlib/puppet/type/file/ensure.rb9
-rwxr-xr-xlib/puppet/type/host.rb2
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index a68bfb189..39c2911bc 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -70,12 +70,16 @@ module Puppet
@checks.keys
end
- newproperty(:returns, :array_matching => :all) do |property|
+ newproperty(:returns, :array_matching => :all, :event => :executed_command) do |property|
include Puppet::Util::Execution
munge do |value|
value.to_s
end
+ def event_name
+ :executed_command
+ end
+
defaultto "0"
attr_reader :output
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb
index c4b5fa188..96369f6b3 100755
--- a/lib/puppet/type/file/ensure.rb
+++ b/lib/puppet/type/file/ensure.rb
@@ -40,7 +40,7 @@ module Puppet
aliasvalue(:false, :absent)
- newvalue(:file) do
+ newvalue(:file, :event => :file_created) do
# Make sure we're not managing the content some other way
if property = (@resource.property(:content) || @resource.property(:source))
property.sync
@@ -48,17 +48,16 @@ module Puppet
@resource.write("", :ensure)
mode = @resource.should(:mode)
end
- return :file_created
end
#aliasvalue(:present, :file)
- newvalue(:present) do
+ newvalue(:present, :event => :file_created) do
# Make a file if they want something, but this will match almost
# anything.
set_file
end
- newvalue(:directory) do
+ newvalue(:directory, :event => :directory_created) do
mode = @resource.should(:mode)
parent = File.dirname(@resource[:path])
unless FileTest.exists? parent
@@ -79,7 +78,7 @@ module Puppet
end
- newvalue(:link) do
+ newvalue(:link, :event => :link_created) do
fail "Cannot create a symlink without a target" unless property = resource.property(:target)
property.retrieve
property.mklink
diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb
index 6c4e07b45..d184fdd68 100755
--- a/lib/puppet/type/host.rb
+++ b/lib/puppet/type/host.rb
@@ -19,7 +19,7 @@ module Puppet
the "alias" metaparam; use this property to add aliases to a host
on disk, and "alias" to aliases for use in your Puppet scripts.'
- def insync?(is)
+ def insync?(is)
is == @should
end