diff options
author | Joshua Miller <joshuamiller01@gmail.com> | 2016-08-26 09:54:38 -0700 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2016-08-26 09:54:38 -0700 |
commit | 3f33d7a105801c31ae7a38334e582068ea94af2b (patch) | |
tree | 1711b52a9189401bcebb0de4d19235c245d0d41d /lib | |
parent | bf7c0f9a698616da9c68adf6c0ca81f27456dc9d (diff) | |
download | chef-3f33d7a105801c31ae7a38334e582068ea94af2b.tar.gz |
Use symbols instead of strings as keys for systemd user property (#5241)
* Use symbols instead of strings as keys for systemd user property related funcs
* Fix tests for provider/service/systemd for when user property is set
* Change hash in systemctl_opts to use symbols instead of strings
* Fix tests for chef/provider/systemd_unit.rb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/service/systemd.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/systemd_unit.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb index 1597d46a3d..712f0f60c3 100644 --- a/lib/chef/provider/service/systemd.rb +++ b/lib/chef/provider/service/systemd.rb @@ -78,10 +78,10 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple if new_resource.user uid = node["etc"]["passwd"][new_resource.user]["uid"] options = { - "environment" => { + :environment => { "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus", }, - "user" => new_resource.user, + :user => new_resource.user, } args = "--user" else diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb index 5b558ba335..4aa4cd0aa2 100644 --- a/lib/chef/provider/systemd_unit.rb +++ b/lib/chef/provider/systemd_unit.rb @@ -225,8 +225,8 @@ class Chef @systemctl_opts ||= if new_resource.user { - "user" => new_resource.user, - "environment" => { + :user => new_resource.user, + :environment => { "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{node['etc']['passwd'][new_resource.user]['uid']}/bus", }, } |