Skip to content

Commit

Permalink
Cookstyle fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Aug 13, 2018
1 parent 426c5b8 commit 02f3565
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ def zfs_get_properties(name)
# @param [Hash] ZFS Property => value
# @return [Boolean]
def zfs_property_already_set?(fs, property)
key = property.keys[0]
new_value = property[property.keys[0]]
cmd = Mixlib::ShellOut.new('zfs', 'get', key.to_s, fs)
cmd.run_command
existing_property = parse_zfs_properties(cmd.stdout)[0]
existing_value = existing_property[existing_property.keys[0]]
existing_value == new_value
key = property.keys[0]
new_value = property[property.keys[0]]
cmd = Mixlib::ShellOut.new('zfs', 'get', key.to_s, fs)
cmd.run_command
existing_property = parse_zfs_properties(cmd.stdout)[0]
existing_value = existing_property[existing_property.keys[0]]
existing_value == new_value
end

# TODO: Add support for setting inheritance from parent filesystems.
Expand All @@ -117,7 +117,7 @@ def zfs_set_properties(fs, properties)

configurable_properties.each do |setting|
next if PROPERTIES_VALID_ONLY_AT_CREATE.include?(setting.keys[0])
next if zfs_property_already_set?(fs, setting)
next if zfs_property_already_set?(fs, setting)
cmd = Mixlib::ShellOut.new('zfs', 'set', "#{setting.keys[0]}=#{setting[setting.keys[0]]}", fs)
cmd.environment['PATH'] = "/usr/sbin:#{ENV['PATH']}" if platform_family?('solaris2')
cmd.run_command
Expand Down

0 comments on commit 02f3565

Please sign in to comment.