Remove unnecessary comments; make the 'option check' a one-liner
This commit is contained in:
Родитель
40bff94f81
Коммит
52040c1301
|
@ -1,22 +1,3 @@
|
|||
# Author:: Eric Hanko (<v-erhank@microsoft.com>)
|
||||
# Cookbook:: macos
|
||||
# Resource:: system_setting
|
||||
#
|
||||
# Copyright:: 2017, Microsoft, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
resource_name :defaults
|
||||
|
||||
BASE_COMMAND = '/usr/bin/defaults'.freeze
|
||||
|
@ -28,13 +9,11 @@ property :settings, Hash
|
|||
property :system, [true, false]
|
||||
|
||||
action :run do
|
||||
if read_only
|
||||
new_resource.option = 'read'
|
||||
end
|
||||
|
||||
new_resource.option = 'read' if read_only
|
||||
settings.each do |setting, value|
|
||||
execute BASE_COMMAND do
|
||||
command "#{BASE_COMMAND} #{new_resource.option} #{new_resource.domain} #{setting} #{value}"
|
||||
command "#{BASE_COMMAND} #{new_resource.option} \
|
||||
#{new_resource.domain} #{setting} #{value}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче