microwave 0.1004.5 → 0.1004.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef.rb +0 -1
- data/lib/chef/client.rb +0 -19
- data/lib/chef/config.rb +7 -58
- data/lib/chef/cookbook/cookbook_version_loader.rb +0 -14
- data/lib/chef/cookbook_version.rb +1 -133
- data/lib/chef/environment.rb +0 -36
- data/lib/chef/handler/json_file.rb +1 -1
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +18 -34
- data/lib/chef/mixin/shell_out.rb +1 -0
- data/lib/chef/node.rb +0 -29
- data/lib/chef/provider/execute.rb +1 -0
- data/lib/chef/provider/file.rb +1 -14
- data/lib/chef/resource.rb +1 -1
- data/lib/chef/role.rb +13 -68
- data/lib/chef/run_context.rb +1 -15
- data/lib/chef/tasks/chef_repo.rake +0 -1
- data/lib/chef/version.rb +1 -1
- metadata +24 -17
- data/lib/chef/monkey_patches/string.rb +0 -49
- data/lib/chef/resource_definition.rb +0 -67
- data/lib/chef/resource_definition_list.rb +0 -38
- data/lib/chef/util/windows/net_group.rb +0 -101
- data/lib/chef/util/windows/net_use.rb +0 -121
- data/lib/chef/util/windows/net_user.rb +0 -198
- data/lib/chef/util/windows/volume.rb +0 -59
@@ -1,59 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Doug MacEachern (<dougm@vmware.com>)
|
3
|
-
# Copyright:: Copyright (c) 2010 VMware, Inc.
|
4
|
-
# License:: Apache License, Version 2.0
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
#simple wrapper around Volume APIs. might be possible with WMI, but possibly more complex.
|
20
|
-
|
21
|
-
require 'chef/util/windows'
|
22
|
-
require 'windows/volume'
|
23
|
-
|
24
|
-
class Chef::Util::Windows::Volume < Chef::Util::Windows
|
25
|
-
|
26
|
-
private
|
27
|
-
include Windows::Volume
|
28
|
-
#XXX not defined in the current windows-pr release
|
29
|
-
DeleteVolumeMountPoint =
|
30
|
-
Windows::API.new('DeleteVolumeMountPoint', 'S', 'B') unless defined? DeleteVolumeMountPoint
|
31
|
-
|
32
|
-
public
|
33
|
-
|
34
|
-
def initialize(name)
|
35
|
-
name += "\\" unless name =~ /\\$/ #trailing slash required
|
36
|
-
@name = name
|
37
|
-
end
|
38
|
-
|
39
|
-
def device
|
40
|
-
buffer = 0.chr * 256
|
41
|
-
if GetVolumeNameForVolumeMountPoint(@name, buffer, buffer.size)
|
42
|
-
return buffer[0,buffer.size].unpack("Z*")[0]
|
43
|
-
else
|
44
|
-
raise ArgumentError, get_last_error
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def delete
|
49
|
-
unless DeleteVolumeMountPoint.call(@name)
|
50
|
-
raise ArgumentError, get_last_error
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def add(device)
|
55
|
-
unless SetVolumeMountPoint(@name, device)
|
56
|
-
raise ArgumentError, get_last_error
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|