Commit 3d454209 authored by Tim Smith's avatar Tim Smith
Browse files

Fix options property not taking on the legacy default valuue

The logic here was backwards. If env property is an empty hash then
that's an unset default and we want to use env_dir. Otherwise return {}
Signed-off-by: Tim Smith's avatarTim Smith <>
parent f25829ee
......@@ -225,7 +225,7 @@ class Chef
# lsb_init
if platform?('debian','ubuntu') && !new_resource.use_init_script_sv_link
if platform?('debian', 'ubuntu') && !new_resource.use_init_script_sv_link
ruby_block "unlink #{::File.join(new_resource.lsb_init_dir, new_resource.service_name)}" do
block { ::File.unlink(::File.join(new_resource.lsb_init_dir, new_resource.service_name).to_s) }
only_if { ::File.symlink?(::File.join(new_resource.lsb_init_dir, new_resource.service_name).to_s) }
......@@ -89,9 +89,9 @@ class Chef
# the default legacy options kept for compatibility with the definition
# @return [Hash] an empty hash if env property is set. Otherwise it's env_dir
# @return [Hash] if env is the default empty hash then return env_dir valuue. Otherwise return an empty hash
def default_options
env.empty? ? {} : { env_dir: ::File.join(sv_dir, service_name, 'env') }
env.empty? ? { env_dir: ::File.join(sv_dir, service_name, 'env') } : {}
def after_created
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment