diff options
author | Tim Smith <tsmith@chef.io> | 2021-07-26 10:37:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 10:37:11 -0700 |
commit | b79135b27d9c0c98a0877fd1019b2df19b07451e (patch) | |
tree | 67421be1a0d8afd8e951528afc5d71dd69667405 | |
parent | 80111b12e3ec63147be8108b9b2167c4ff7ecd9b (diff) | |
parent | 275371a7a95209759f4b39479e230aa49373329f (diff) | |
download | chef-b79135b27d9c0c98a0877fd1019b2df19b07451e.tar.gz |
Merge pull request #11856 from MsysTechnologiesllc/antima/removed_space_arround_equal_sign_systemd_unit
systemd_unit generates invalid units when passing a hash issue fix
-rw-r--r-- | lib/chef/resource/systemd_unit.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/systemd_unit_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb index f6384ac947..a100f29add 100644 --- a/lib/chef/resource/systemd_unit.rb +++ b/lib/chef/resource/systemd_unit.rb @@ -113,7 +113,7 @@ class Chef when Hash IniParse.gen do |doc| content.each_pair do |sect, opts| - doc.section(sect) do |section| + doc.section(sect, { option_sep: "=" }) do |section| opts.each_pair do |opt, val| [val].flatten.each do |v| section.option(opt, v) diff --git a/spec/unit/resource/systemd_unit_spec.rb b/spec/unit/resource/systemd_unit_spec.rb index f05418eb34..737559be73 100644 --- a/spec/unit/resource/systemd_unit_spec.rb +++ b/spec/unit/resource/systemd_unit_spec.rb @@ -20,7 +20,7 @@ require "spec_helper" describe Chef::Resource::SystemdUnit do let(:resource) { Chef::Resource::SystemdUnit.new("sysstat-collect.timer") } - let(:unit_content_string) { "[Unit]\nDescription = Run system activity accounting tool every 10 minutes\nDocumentation = foo\nDocumentation = bar\n\n[Timer]\nOnCalendar = *:00/10\n\n[Install]\nWantedBy = sysstat.service\n" } + let(:unit_content_string) { "[Unit]\nDescription=Run system activity accounting tool every 10 minutes\nDocumentation=foo\nDocumentation=bar\n\n[Timer]\nOnCalendar=*:00/10\n\n[Install]\nWantedBy=sysstat.service\n" } let(:unit_content_hash) do { "Unit" => { |