puppet 3.3.1 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +14 -13
- data/Rakefile +0 -11
- data/ext/build_defaults.yaml +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +9 -1
- data/lib/puppet/provider/package/rpm.rb +2 -2
- data/lib/puppet/type/user.rb +3 -2
- data/lib/puppet/util/adsi.rb +2 -2
- data/lib/puppet/util/execution.rb +2 -2
- data/lib/puppet/version.rb +1 -1
- data/spec/unit/provider/group/windows_adsi_spec.rb +1 -1
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/rpm_spec.rb +5 -5
- data/spec/unit/provider/package/yum_spec.rb +1 -1
- data/spec/unit/provider/user/windows_adsi_spec.rb +1 -1
- data/spec/unit/util/adsi_spec.rb +2 -2
- data/spec/unit/util/execution_spec.rb +2 -2
- data/tasks/ci.rake +48 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2d87f415f2d5c4d6c42e63ff26236626b2d99a4
|
4
|
+
data.tar.gz: c8d13e9583a907081e8f498b82676a8740a0adf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7b5edc26a97b652f61f338c596aed36fec7bb5ef3baa73a02df507a3d3b6553b160a208f9bf5c3eb80423f9b313c457f09a521debdc5277558b2310c9f278d
|
7
|
+
data.tar.gz: 789d4cf034c461fd1f2482686dcca9099e54dd6b723922c05b82119c29a9f9a0079174a4e0bc92bcf1e514320cd0342806f700d2fc1896eed02146f5ede11852
|
data/Gemfile
CHANGED
@@ -15,7 +15,7 @@ platforms :ruby do
|
|
15
15
|
gem 'pry', :group => :development
|
16
16
|
gem 'yard', :group => :development
|
17
17
|
gem 'redcarpet', '~> 2.0', :group => :development
|
18
|
-
gem "racc", "
|
18
|
+
gem "racc", "1.4.9", :group => :development
|
19
19
|
end
|
20
20
|
|
21
21
|
gem "puppet", :path => File.dirname(__FILE__), :require => false
|
@@ -51,18 +51,19 @@ group(:extra) do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
platforms :mswin, :mingw do
|
54
|
-
gem "
|
55
|
-
gem "
|
56
|
-
gem "win32-
|
57
|
-
gem "win32-
|
58
|
-
gem "win32-
|
59
|
-
gem "win32-
|
60
|
-
gem "win32-
|
61
|
-
gem "win32-
|
62
|
-
gem "
|
63
|
-
gem "
|
64
|
-
gem "windows-
|
65
|
-
gem "
|
54
|
+
gem "ffi", "1.9.0", :require => false
|
55
|
+
gem "sys-admin", "1.5.6", :require => false
|
56
|
+
gem "win32-api", "1.4.8", :require => false
|
57
|
+
gem "win32-dir", "0.4.3", :require => false
|
58
|
+
gem "win32-eventlog", "0.5.3", :require => false
|
59
|
+
gem "win32-process", "0.6.5", :require => false
|
60
|
+
gem "win32-security", "0.1.4", :require => false
|
61
|
+
gem "win32-service", "0.7.2", :require => false
|
62
|
+
gem "win32-taskscheduler", "0.2.2", :require => false
|
63
|
+
gem "win32console", "1.3.2", :require => false
|
64
|
+
gem "windows-api", "0.4.2", :require => false
|
65
|
+
gem "windows-pr", "1.2.2", :require => false
|
66
|
+
gem "minitar", "0.5.4", :require => false
|
66
67
|
end
|
67
68
|
|
68
69
|
if File.exists? "#{__FILE__}.local"
|
data/Rakefile
CHANGED
@@ -66,14 +66,3 @@ end
|
|
66
66
|
task :spec do
|
67
67
|
sh %{rspec -fd spec}
|
68
68
|
end
|
69
|
-
|
70
|
-
namespace "ci" do
|
71
|
-
task :spec do
|
72
|
-
ENV["LOG_SPEC_ORDER"] = "true"
|
73
|
-
sh %{rspec -r yarjuf -f JUnit -o result.xml -fd spec}
|
74
|
-
end
|
75
|
-
|
76
|
-
task :el6tests do
|
77
|
-
sh "cd acceptance/config/el6; rm -f el6.tar.gz; tar -czvf el6.tar.gz *"
|
78
|
-
end
|
79
|
-
end
|
data/ext/build_defaults.yaml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master'
|
3
3
|
packaging_repo: 'packaging'
|
4
4
|
default_cow: 'base-squeeze-i386.cow'
|
5
|
-
cows: 'base-lucid-i386.cow base-precise-i386.cow base-quantal-i386.cow base-raring-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow'
|
5
|
+
cows: 'base-lucid-i386.cow base-precise-i386.cow base-quantal-i386.cow base-raring-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow base-saucy-i386.cow'
|
6
6
|
pbuild_conf: '/etc/pbuilderrc'
|
7
7
|
packager: 'puppetlabs'
|
8
8
|
gpg_name: 'info@puppetlabs.com'
|
@@ -118,7 +118,7 @@ module PSON
|
|
118
118
|
else
|
119
119
|
raise TypeError, "#{source.inspect} is not like a string"
|
120
120
|
end
|
121
|
-
if
|
121
|
+
if supports_encodings?(source)
|
122
122
|
if source.encoding == ::Encoding::ASCII_8BIT
|
123
123
|
b = source[0, 4].bytes.to_a
|
124
124
|
source =
|
@@ -157,6 +157,14 @@ module PSON
|
|
157
157
|
source
|
158
158
|
end
|
159
159
|
|
160
|
+
def supports_encodings?(string)
|
161
|
+
# Some modules, such as REXML on 1.8.7 (see #22804) can actually create
|
162
|
+
# a top-level Encoding constant when they are misused. Therefore
|
163
|
+
# checking for just that constant is not enough, so we'll be a bit more
|
164
|
+
# robust about if we can actually support encoding transformations.
|
165
|
+
string.respond_to?(:encoding) && defined?(::Encoding)
|
166
|
+
end
|
167
|
+
|
160
168
|
# Unescape characters in strings.
|
161
169
|
UNESCAPE_MAP = Hash.new { |h, k| h[k] = k.chr }
|
162
170
|
|
@@ -11,7 +11,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr
|
|
11
11
|
# eventually become this Puppet:Type::Package::ProviderRpm class.
|
12
12
|
self::RPM_DESCRIPTION_DELIMITER = ':DESC:'
|
13
13
|
# The query format by which we identify installed packages
|
14
|
-
self::NEVRA_FORMAT = %Q{
|
14
|
+
self::NEVRA_FORMAT = %Q{%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} #{self::RPM_DESCRIPTION_DELIMITER} %{SUMMARY}\\n}
|
15
15
|
self::NEVRA_REGEX = %r{^(\S+) (\S+) (\S+) (\S+) (\S+)(?: #{self::RPM_DESCRIPTION_DELIMITER} ?(.*))?$}
|
16
16
|
self::RPM_PACKAGE_NOT_FOUND_REGEX = /package .+ is not installed/
|
17
17
|
self::NEVRA_FIELDS = [:name, :epoch, :version, :release, :arch, :description]
|
@@ -49,7 +49,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr
|
|
49
49
|
|
50
50
|
# list out all of the packages
|
51
51
|
begin
|
52
|
-
execpipe("#{command(:rpm)} -qa #{nosignature} #{nodigest} --qf #{self::NEVRA_FORMAT}") { |process|
|
52
|
+
execpipe("#{command(:rpm)} -qa #{nosignature} #{nodigest} --qf '#{self::NEVRA_FORMAT}'") { |process|
|
53
53
|
# now turn each returned line into a package object
|
54
54
|
process.each_line { |line|
|
55
55
|
hash = nevra_to_hash(line)
|
data/lib/puppet/type/user.rb
CHANGED
@@ -124,8 +124,9 @@ module Puppet
|
|
124
124
|
newproperty(:gid) do
|
125
125
|
desc "The user's primary group. Can be specified numerically or by name.
|
126
126
|
|
127
|
-
|
128
|
-
|
127
|
+
This attribute is not supported on Windows systems; use the `groups`
|
128
|
+
attribute instead. (On Windows, designating a primary group is only
|
129
|
+
meaningful for domain accounts, which Puppet does not currently manage.)"
|
129
130
|
|
130
131
|
munge do |value|
|
131
132
|
if value.is_a?(String) and value =~ /^[-0-9]+$/
|
data/lib/puppet/util/adsi.rb
CHANGED
@@ -175,7 +175,7 @@ module Puppet::Util::ADSI
|
|
175
175
|
end
|
176
176
|
|
177
177
|
def self.each(&block)
|
178
|
-
wql = Puppet::Util::ADSI.execquery(
|
178
|
+
wql = Puppet::Util::ADSI.execquery('select name from win32_useraccount where localaccount = "TRUE"')
|
179
179
|
|
180
180
|
users = []
|
181
181
|
wql.each do |u|
|
@@ -283,7 +283,7 @@ module Puppet::Util::ADSI
|
|
283
283
|
end
|
284
284
|
|
285
285
|
def self.each(&block)
|
286
|
-
wql = Puppet::Util::ADSI.execquery(
|
286
|
+
wql = Puppet::Util::ADSI.execquery( 'select name from win32_group where localaccount = "TRUE"' )
|
287
287
|
|
288
288
|
groups = []
|
289
289
|
wql.each do |g|
|
@@ -147,8 +147,8 @@ module Util::Execution
|
|
147
147
|
begin
|
148
148
|
exit_status = Puppet::Util::Windows::Process.wait_process(process_info.process_handle)
|
149
149
|
ensure
|
150
|
-
Process.CloseHandle(process_info.process_handle)
|
151
|
-
Process.CloseHandle(process_info.thread_handle)
|
150
|
+
Puppet::Util::Windows::Process.CloseHandle(process_info.process_handle)
|
151
|
+
Puppet::Util::Windows::Process.CloseHandle(process_info.thread_handle)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
data/lib/puppet/version.rb
CHANGED
@@ -24,7 +24,7 @@ describe Puppet::Type.type(:group).provider(:windows_adsi) do
|
|
24
24
|
names = ['group1', 'group2', 'group3']
|
25
25
|
stub_groups = names.map{|n| stub(:name => n)}
|
26
26
|
|
27
|
-
connection.stubs(:execquery).with(
|
27
|
+
connection.stubs(:execquery).with('select name from win32_group where localaccount = "TRUE"').returns stub_groups
|
28
28
|
|
29
29
|
described_class.instances.map(&:name).should =~ names
|
30
30
|
end
|
@@ -19,7 +19,7 @@ describe Puppet::Type.type(:package).provider(:aptrpm) do
|
|
19
19
|
def rpm
|
20
20
|
pkg.provider.expects(:rpm).
|
21
21
|
with('-q', 'faff', '--nosignature', '--nodigest', '--qf',
|
22
|
-
"
|
22
|
+
"%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} :DESC: %{SUMMARY}\\n")
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should report absent packages" do
|
@@ -30,7 +30,7 @@ describe provider_class do
|
|
30
30
|
provider
|
31
31
|
end
|
32
32
|
|
33
|
-
let(:nevra_format) { %Q{
|
33
|
+
let(:nevra_format) { %Q{%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} :DESC: %{SUMMARY}\\n} }
|
34
34
|
let(:execute_options) do
|
35
35
|
{:failonfail => true, :combine => true, :custom_environment => {}}
|
36
36
|
end
|
@@ -47,7 +47,7 @@ describe provider_class do
|
|
47
47
|
describe "self.instances" do
|
48
48
|
describe "with a modern version of RPM" do
|
49
49
|
it "should include all the modern flags" do
|
50
|
-
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf #{nevra_format}").yields(packages)
|
50
|
+
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf '#{nevra_format}'").yields(packages)
|
51
51
|
|
52
52
|
installed_packages = subject.instances
|
53
53
|
end
|
@@ -56,7 +56,7 @@ describe provider_class do
|
|
56
56
|
describe "with a version of RPM < 4.1" do
|
57
57
|
let(:rpm_version) { "RPM version 4.0.2\n" }
|
58
58
|
it "should exclude the --nosignature flag" do
|
59
|
-
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nodigest --qf #{nevra_format}").yields(packages)
|
59
|
+
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nodigest --qf '#{nevra_format}'").yields(packages)
|
60
60
|
|
61
61
|
installed_packages = subject.instances
|
62
62
|
end
|
@@ -65,14 +65,14 @@ describe provider_class do
|
|
65
65
|
describe "with a version of RPM < 4.0.2" do
|
66
66
|
let(:rpm_version) { "RPM version 3.0.5\n" }
|
67
67
|
it "should exclude the --nodigest flag" do
|
68
|
-
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --qf #{nevra_format}").yields(packages)
|
68
|
+
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --qf '#{nevra_format}'").yields(packages)
|
69
69
|
|
70
70
|
installed_packages = subject.instances
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
74
|
it "returns an array of packages" do
|
75
|
-
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf #{nevra_format}").yields(packages)
|
75
|
+
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf '#{nevra_format}'").yields(packages)
|
76
76
|
|
77
77
|
installed_packages = subject.instances
|
78
78
|
|
@@ -153,7 +153,7 @@ _pkg mysummaryless 0 1.2.3.4 5.el4 noarch
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def expect_execpipe_to_provide_package_info_for_an_rpm_query
|
156
|
-
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf #{nevra_format}").yields(packages)
|
156
|
+
Puppet::Util::Execution.expects(:execpipe).with("/bin/rpm -qa --nosignature --nodigest --qf '#{nevra_format}'").yields(packages)
|
157
157
|
end
|
158
158
|
|
159
159
|
def expect_python_yumhelper_call_to_return_latest_info
|
@@ -24,7 +24,7 @@ describe Puppet::Type.type(:user).provider(:windows_adsi) do
|
|
24
24
|
it "should enumerate all users" do
|
25
25
|
names = ['user1', 'user2', 'user3']
|
26
26
|
stub_users = names.map{|n| stub(:name => n)}
|
27
|
-
connection.stubs(:execquery).with(
|
27
|
+
connection.stubs(:execquery).with('select name from win32_useraccount where localaccount = "TRUE"').returns(stub_users)
|
28
28
|
|
29
29
|
described_class.instances.map(&:name).should =~ names
|
30
30
|
end
|
data/spec/unit/util/adsi_spec.rb
CHANGED
@@ -85,7 +85,7 @@ describe Puppet::Util::ADSI do
|
|
85
85
|
it "should return an enumeration of IADsUser wrapped objects" do
|
86
86
|
name = 'Administrator'
|
87
87
|
wmi_users = [stub('WMI', :name => name)]
|
88
|
-
Puppet::Util::ADSI.expects(:execquery).with(
|
88
|
+
Puppet::Util::ADSI.expects(:execquery).with('select name from win32_useraccount where localaccount = "TRUE"').returns(wmi_users)
|
89
89
|
|
90
90
|
native_user = stub('IADsUser')
|
91
91
|
homedir = "C:\\Users\\#{name}"
|
@@ -248,7 +248,7 @@ describe Puppet::Util::ADSI do
|
|
248
248
|
it "should return an enumeration of IADsGroup wrapped objects" do
|
249
249
|
name = 'Administrators'
|
250
250
|
wmi_groups = [stub('WMI', :name => name)]
|
251
|
-
Puppet::Util::ADSI.expects(:execquery).with(
|
251
|
+
Puppet::Util::ADSI.expects(:execquery).with('select name from win32_group where localaccount = "TRUE"').returns(wmi_groups)
|
252
252
|
|
253
253
|
native_group = stub('IADsGroup')
|
254
254
|
native_group.expects(:Members).returns([stub(:Name => 'Administrator')])
|
@@ -306,8 +306,8 @@ describe Puppet::Util::Execution do
|
|
306
306
|
Puppet::Util::Execution.stubs(:execute_windows).returns(proc_info_stub)
|
307
307
|
|
308
308
|
Puppet::Util::Windows::Process.expects(:wait_process).with(process_handle).raises('whatever')
|
309
|
-
Process.expects(:CloseHandle).with(thread_handle)
|
310
|
-
Process.expects(:CloseHandle).with(process_handle)
|
309
|
+
Puppet::Util::Windows::Process.expects(:CloseHandle).with(thread_handle)
|
310
|
+
Puppet::Util::Windows::Process.expects(:CloseHandle).with(process_handle)
|
311
311
|
|
312
312
|
expect { Puppet::Util::Execution.execute('test command') }.to raise_error(RuntimeError)
|
313
313
|
end
|
data/tasks/ci.rake
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
namespace "ci" do
|
2
|
+
task :spec do
|
3
|
+
ENV["LOG_SPEC_ORDER"] = "true"
|
4
|
+
sh %{rspec -r yarjuf -f JUnit -o result.xml -fd spec}
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_parameter_value_from_actions(actions, parameter)
|
8
|
+
parameters = actions.select { |h| h.key?('parameters') }.first["parameters"]
|
9
|
+
parameters.select { |h| h['name'] == parameter }.first['value']
|
10
|
+
end
|
11
|
+
|
12
|
+
desc <<-EOS
|
13
|
+
Check to see if the job at the url given in DOWNSTREAM_JOB has begun a build including the given BUILD_SELECTOR parameter.
|
14
|
+
An example `rake ci:check_for_downstream DOWNSTREAM_JOB='http://jenkins-foss.delivery.puppetlabs.net/job/Puppet-Package-Acceptance-master' BUILD_SELECTOR=123`
|
15
|
+
You may optionally set TIMEOUT_MIN, which defaults to 20 min.
|
16
|
+
EOS
|
17
|
+
task :check_for_downstream do
|
18
|
+
downstream_url = ENV['DOWNSTREAM_JOB'] || raise('No ENV DOWNSTREAM_JOB set!')
|
19
|
+
downstream_url += '/api/json?depth=1'
|
20
|
+
expected_selector = ENV['BUILD_SELECTOR'] || raise('No ENV BUILD_SELECTOR set!')
|
21
|
+
timeout = (ENV['TIMEOUT_MIN'] || 20) * 60
|
22
|
+
puts "Waiting for a downstream job calling for BUILD_SELECTOR #{expected_selector}"
|
23
|
+
success = false
|
24
|
+
require 'json'
|
25
|
+
require 'timeout'
|
26
|
+
require 'net/http'
|
27
|
+
Timeout.timeout(timeout) do
|
28
|
+
loop do
|
29
|
+
uri = URI(downstream_url)
|
30
|
+
status = Net::HTTP.get(uri)
|
31
|
+
json = JSON.parse(status)
|
32
|
+
build_selector = get_parameter_value_from_actions(json['builds'].first['actions'], 'BUILD_SELECTOR')
|
33
|
+
if build_selector < expected_selector && json['queueItem']
|
34
|
+
queued_actions = json['queueItem']['actions']
|
35
|
+
build_selector = get_parameter_value_from_actions(queued_actions, 'BUILD_SELECTOR') if queued_actions
|
36
|
+
end
|
37
|
+
puts " * downstream job's last build selector: #{build_selector}"
|
38
|
+
break if build_selector >= expected_selector
|
39
|
+
sleep 60
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Tar up the acceptance/ directory so that package test runs have tests to run against."
|
45
|
+
task :acceptance_artifacts do
|
46
|
+
sh "cd acceptance; rm -f acceptance-artifacts.tar.gz; tar -czv --exclude .bundle -f acceptance-artifacts.tar.gz *"
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -1200,6 +1200,7 @@ files:
|
|
1200
1200
|
- ext/windows/service/daemon.bat
|
1201
1201
|
- ext/windows/service/daemon.rb
|
1202
1202
|
- ext/yaml_nodes.rb
|
1203
|
+
- tasks/ci.rake
|
1203
1204
|
- tasks/manpages.rake
|
1204
1205
|
- tasks/parser.rake
|
1205
1206
|
- spec/fixtures/faulty_face/puppet/face/syntax.rb
|