Method: Chef::Resource::File::Verification::SystemdUnit#verify

Defined in:
lib/chef/resource/file/verification/systemd_unit.rb

#verify(path, opts = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/chef/resource/file/verification/systemd_unit.rb', line 47

def verify(path, opts = {})
  return true unless systemd_analyze_path

  # Verification uses guards, which are not yet fully supported in TM
  return true if Chef::Config.target_mode?

  Dir.mktmpdir("chef-systemd-unit") do |dir|
    temp = "#{dir}/#{::File.basename(@parent_resource.path)}"
    ::TargetIO::FileUtils.cp(path, temp)
    verify_command(temp, opts)
  end
end