Skip to content

Commit

Permalink
consul_watch: Get user and group defaults from attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed May 31, 2017
1 parent a23d96c commit c0508c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/consul_watch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class ConsulWatch < Chef::Resource

# @!attribute user
# @return [String]
attribute(:user, kind_of: String, default: 'consul')
attribute(:user, kind_of: String, default: lazy { node['consul']['service_user'] })

# @!attribute group
# @return [String]
attribute(:group, kind_of: String, default: 'consul')
attribute(:group, kind_of: String, default: lazy { node['consul']['service_group'] })

# @!attribute type
# @return [String]
Expand Down
2 changes: 2 additions & 0 deletions test/spec/libraries/consul_watch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
let(:chefspec_options) { { platform: 'ubuntu', version: '14.04' } }
before do
default_attributes['consul'] = {
'service_user' => 'consul',
'service_group' => 'consul',
'service' => {
'config_dir' => '/etc/consul/conf.d',
},
Expand Down

0 comments on commit c0508c3

Please sign in to comment.