summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-07-26 10:37:11 -0700
committerGitHub <noreply@github.com>2021-07-26 10:37:11 -0700
commitb79135b27d9c0c98a0877fd1019b2df19b07451e (patch)
tree67421be1a0d8afd8e951528afc5d71dd69667405
parent80111b12e3ec63147be8108b9b2167c4ff7ecd9b (diff)
parent275371a7a95209759f4b39479e230aa49373329f (diff)
downloadchef-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.rb2
-rw-r--r--spec/unit/resource/systemd_unit_spec.rb2
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" => {