fix unless
This commit is contained in:
parent
246f2164c6
commit
d5c3649e6a
@ -10,7 +10,9 @@ Puppet::Type.type(:configure).provide(:action) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def exists?
|
def exists?
|
||||||
unless? || File.file?(config_status)
|
return true if unless?
|
||||||
|
|
||||||
|
File.file?(config_status)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -19,7 +21,7 @@ Puppet::Type.type(:configure).provide(:action) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unless?
|
def unless?
|
||||||
return true if @resource[:unless].empty?
|
return nil if @resource[:unless].empty?
|
||||||
|
|
||||||
system %{bash -c '#{@resource[:unless]}'}
|
system %{bash -c '#{@resource[:unless]}'}
|
||||||
$?.exitstatus == 0
|
$?.exitstatus == 0
|
||||||
|
@ -15,12 +15,14 @@ Puppet::Type.type(:download_and_unpack).provide(:action) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def exists?
|
def exists?
|
||||||
unless? || (File.directory?(File.join(@resource[:src_path], target_dir)))
|
return true if unless?
|
||||||
|
|
||||||
|
File.directory?(File.join(@resource[:src_path], target_dir))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def unless?
|
def unless?
|
||||||
return true if @resource[:unless].empty?
|
return nil if @resource[:unless].empty?
|
||||||
|
|
||||||
system %{bash -c '#{@resource[:unless]}'}
|
system %{bash -c '#{@resource[:unless]}'}
|
||||||
|
|
||||||
|
@ -16,12 +16,14 @@ Puppet::Type.type(:make_and_install).provide(:action) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def exists?
|
def exists?
|
||||||
unless? || (File.directory?(@resource[:install_path]) && File.symlink?(symlink_path))
|
return true if unless?
|
||||||
|
|
||||||
|
File.directory?(@resource[:install_path]) && File.symlink?(symlink_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def unless?
|
def unless?
|
||||||
return true if @resource[:unless].empty?
|
return nil if @resource[:unless].empty?
|
||||||
|
|
||||||
system %{bash -c '#{@resource[:unless]}'}
|
system %{bash -c '#{@resource[:unless]}'}
|
||||||
$?.exitstatus == 0
|
$?.exitstatus == 0
|
||||||
|
Loading…
Reference in New Issue
Block a user