summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-27 15:34:05 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-08-28 17:19:37 -0700
commita84f30da26f47aeeab2d13a775cb4d33e8c34fd6 (patch)
tree9598c29e018dc6b3c29a471753ff7f9fffdc5ae6 /lib
parent9b4a7da265329ffc4a41f565f3932c2b0d681a62 (diff)
downloadchef-a84f30da26f47aeeab2d13a775cb4d33e8c34fd6.tar.gz
Remove unused things
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/util/windows/net_use.rb54
1 files changed, 1 insertions, 53 deletions
diff --git a/lib/chef/util/windows/net_use.rb b/lib/chef/util/windows/net_use.rb
index e2a91db1a4..b94576e702 100644
--- a/lib/chef/util/windows/net_use.rb
+++ b/lib/chef/util/windows/net_use.rb
@@ -24,59 +24,7 @@ require 'chef/util/windows'
require 'chef/win32/net'
class Chef::Util::Windows::NetUse < Chef::Util::Windows
-
- private
-
- USE_NOFORCE = 0
- USE_FORCE = 1
- USE_LOTS_OF_FORCE = 2 #every windows API should support this flag
-
- USE_INFO_2 = [
- [:local, nil],
- [:remote, nil],
- [:password, nil],
- [:status, 0],
- [:asg_type, 0],
- [:refcount, 0],
- [:usecount, 0],
- [:username, nil],
- [:domainname, nil]
- ]
-
- USE_INFO_2_TEMPLATE =
- USE_INFO_2.collect { |field| field[1].class == Fixnum ? 'i' : 'L' }.join
-
- SIZEOF_USE_INFO_2 = #sizeof(USE_INFO_2)
- USE_INFO_2.inject(0) do |sum, item|
- sum + (item[1].class == Fixnum ? 4 : PTR_SIZE)
- end
-
- def use_info_2(args)
- USE_INFO_2.collect { |field|
- args.include?(field[0]) ? args[field[0]] : field[1]
- }
- end
-
- def use_info_2_pack(use)
- use.collect { |v|
- v.class == Fixnum ? v : str_to_ptr(multi_to_wide(v))
- }.pack(USE_INFO_2_TEMPLATE)
- end
-
- def use_info_2_unpack(buffer)
- use = Hash.new
- USE_INFO_2.each_with_index do |field,offset|
- use[field[0]] = field[1].class == Fixnum ?
- dword_to_i(buffer, offset) : lpwstr_to_s(buffer, offset)
- end
- use
- end
-
- public
-
def initialize(localname)
- @localname = localname
- @name = multi_to_wide(localname)
@use_name = localname
end
@@ -93,7 +41,7 @@ class Chef::Util::Windows::NetUse < Chef::Util::Windows
args = Hash.new
args[:remote] = remote
end
- args[:local] ||= @localname
+ args[:local] ||= use_name
ui2_hash = to_ui2_struct(args)
begin