diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
commit | 35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch) | |
tree | 452c84ce196ce00d672c71a8fa65f86c5a074fac /lib/chef/win32 | |
parent | eda2808dce8146bfdb308dd658b1dd565df3562b (diff) | |
download | chef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz |
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/registry.rb | 16 | ||||
-rw-r--r-- | lib/chef/win32/security/securable_object.rb | 12 | ||||
-rw-r--r-- | lib/chef/win32/version.rb | 30 |
3 files changed, 29 insertions, 29 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 1193911b00..b1365fd61b 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -56,7 +56,7 @@ class Chef hive, key = get_hive_and_key(key_path) key_exists!(key_path) values = hive.open(key, ::Win32::Registry::KEY_READ | registry_system_architecture) do |reg| - reg.map { |name, type, data| { :name => name, :type => get_name_from_type(type), :data => data } } + reg.map { |name, type, data| { name: name, type: get_name_from_type(type), data: data } } end end @@ -321,13 +321,13 @@ class Chef def _type_name_map { - :binary => ::Win32::Registry::REG_BINARY, - :string => ::Win32::Registry::REG_SZ, - :multi_string => ::Win32::Registry::REG_MULTI_SZ, - :expand_string => ::Win32::Registry::REG_EXPAND_SZ, - :dword => ::Win32::Registry::REG_DWORD, - :dword_big_endian => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - :qword => ::Win32::Registry::REG_QWORD, + binary: ::Win32::Registry::REG_BINARY, + string: ::Win32::Registry::REG_SZ, + multi_string: ::Win32::Registry::REG_MULTI_SZ, + expand_string: ::Win32::Registry::REG_EXPAND_SZ, + dword: ::Win32::Registry::REG_DWORD, + dword_big_endian: ::Win32::Registry::REG_DWORD_BIG_ENDIAN, + qword: ::Win32::Registry::REG_QWORD, } end diff --git a/lib/chef/win32/security/securable_object.rb b/lib/chef/win32/security/securable_object.rb index aef1a72c8c..16841413b7 100644 --- a/lib/chef/win32/security/securable_object.rb +++ b/lib/chef/win32/security/securable_object.rb @@ -71,36 +71,36 @@ class Chef end def dacl=(val) - Security.set_named_security_info(path, type, :dacl => val) + Security.set_named_security_info(path, type, dacl: val) end # You don't set dacl_inherits without also setting dacl, # because Windows gets angry and denies you access. So # if you want to do that, you may as well do both at once. def set_dacl(dacl, dacl_inherits) - Security.set_named_security_info(path, type, :dacl => dacl, :dacl_inherits => dacl_inherits) + Security.set_named_security_info(path, type, dacl: dacl, dacl_inherits: dacl_inherits) end def group=(val) - Security.set_named_security_info(path, type, :group => val) + Security.set_named_security_info(path, type, group: val) end def owner=(val) # TODO to fix serious permissions problems, we may need to enable SeBackupPrivilege. But we might need it (almost) everywhere else, too. Security.with_privileges("SeTakeOwnershipPrivilege", "SeRestorePrivilege") do - Security.set_named_security_info(path, type, :owner => val) + Security.set_named_security_info(path, type, owner: val) end end def sacl=(val) Security.with_privileges("SeSecurityPrivilege") do - Security.set_named_security_info(path, type, :sacl => val) + Security.set_named_security_info(path, type, sacl: val) end end def set_sacl(sacl, sacl_inherits) Security.with_privileges("SeSecurityPrivilege") do - Security.set_named_security_info(path, type, :sacl => sacl, :sacl_inherits => sacl_inherits) + Security.set_named_security_info(path, type, sacl: sacl, sacl_inherits: sacl_inherits) end end end diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb index 944cb207f5..f96fd18316 100644 --- a/lib/chef/win32/version.rb +++ b/lib/chef/win32/version.rb @@ -50,21 +50,21 @@ class Chef private_class_method :method_name_from_marketing_name WIN_VERSIONS = { - "Windows 10" => { :major => 10, :minor => 0, :callable => lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, - "Windows Server 2016" => { :major => 10, :minor => 0, :callable => lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, - "Windows 8.1" => { :major => 6, :minor => 3, :callable => lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, - "Windows Server 2012 R2" => { :major => 6, :minor => 3, :callable => lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, - "Windows 8" => { :major => 6, :minor => 2, :callable => lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, - "Windows Server 2012" => { :major => 6, :minor => 2, :callable => lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, - "Windows 7" => { :major => 6, :minor => 1, :callable => lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, - "Windows Server 2008 R2" => { :major => 6, :minor => 1, :callable => lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, - "Windows Server 2008" => { :major => 6, :minor => 0, :callable => lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, - "Windows Vista" => { :major => 6, :minor => 0, :callable => lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, - "Windows Server 2003 R2" => { :major => 5, :minor => 2, :callable => lambda { |product_type, suite_mask| get_system_metrics(SM_SERVERR2) != 0 } }, - "Windows Home Server" => { :major => 5, :minor => 2, :callable => lambda { |product_type, suite_mask| (suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER } }, - "Windows Server 2003" => { :major => 5, :minor => 2, :callable => lambda { |product_type, suite_mask| get_system_metrics(SM_SERVERR2) == 0 } }, - "Windows XP" => { :major => 5, :minor => 1 }, - "Windows 2000" => { :major => 5, :minor => 0 }, + "Windows 10" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, + "Windows Server 2016" => { major: 10, minor: 0, callable: lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, + "Windows 8.1" => { major: 6, minor: 3, callable: lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, + "Windows Server 2012 R2" => { major: 6, minor: 3, callable: lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, + "Windows 8" => { major: 6, minor: 2, callable: lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, + "Windows Server 2012" => { major: 6, minor: 2, callable: lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, + "Windows 7" => { major: 6, minor: 1, callable: lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, + "Windows Server 2008 R2" => { major: 6, minor: 1, callable: lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, + "Windows Server 2008" => { major: 6, minor: 0, callable: lambda { |product_type, suite_mask| product_type != VER_NT_WORKSTATION } }, + "Windows Vista" => { major: 6, minor: 0, callable: lambda { |product_type, suite_mask| product_type == VER_NT_WORKSTATION } }, + "Windows Server 2003 R2" => { major: 5, minor: 2, callable: lambda { |product_type, suite_mask| get_system_metrics(SM_SERVERR2) != 0 } }, + "Windows Home Server" => { major: 5, minor: 2, callable: lambda { |product_type, suite_mask| (suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER } }, + "Windows Server 2003" => { major: 5, minor: 2, callable: lambda { |product_type, suite_mask| get_system_metrics(SM_SERVERR2) == 0 } }, + "Windows XP" => { major: 5, minor: 1 }, + "Windows 2000" => { major: 5, minor: 0 }, } def initialize |