summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantima-gupta <agupta@msystechnologies.com>2021-07-23 17:56:07 +0530
committerantima-gupta <agupta@msystechnologies.com>2021-07-23 17:56:07 +0530
commit4ff2ef88f780f4425347c5624454a4580732f0cb (patch)
treeda1f4f7ba704d81be22d143ec956da5a44ed9891
parent1f76c20ab6f6479e8c0ef32399cc6780a32ca42d (diff)
downloadchef-4ff2ef88f780f4425347c5624454a4580732f0cb.tar.gz
Fixed generates systemd service should not have spaces around the equal signs.
Fixed testcase failure. Signed-off-by: antima-gupta <agupta@msystechnologies.com>
-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..93d4757638 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" => {