puppet 2.7.24 → 2.7.25

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.

data/Rakefile CHANGED
@@ -20,7 +20,11 @@ end
20
20
  require 'rake'
21
21
 
22
22
  Dir['tasks/**/*.rake'].each { |t| load t }
23
- Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
23
+
24
+ begin
25
+ load File.join(File.dirname(__FILE__), 'ext', 'packaging', 'packaging.rake')
26
+ rescue LoadError
27
+ end
24
28
 
25
29
  build_defs_file = 'ext/build_defaults.yaml'
26
30
  if File.exist?(build_defs_file)
@@ -69,3 +73,8 @@ desc "Run the unit tests"
69
73
  task :unit do
70
74
  Dir.chdir("test") { sh "rake" }
71
75
  end
76
+
77
+ desc "Run the spec tests on windows"
78
+ task :windows_spec do
79
+ sh %{rspec --tag ~fails_on_windows #{ENV['TESTS'] || 'spec'}}
80
+ end
@@ -292,6 +292,9 @@ def set_cow_envs(cow)
292
292
  end
293
293
  ENV['DIST'] = dist
294
294
  ENV['ARCH'] = arch
295
+ if dist =~ /cumulus/
296
+ ENV['NETWORK_OS'] = 'cumulus'
297
+ end
295
298
  end
296
299
 
297
300
  def ln(target, name)
@@ -108,7 +108,12 @@ namespace :pl do
108
108
  #
109
109
  # Determine the type of build we're doing to inform jenkins
110
110
  build_type = case build_task
111
- when /deb/ then "deb"
111
+ when /deb/
112
+ if @build.default_cow.split('-')[1] =~ /cumulus/
113
+ "cumulus"
114
+ else
115
+ "deb"
116
+ end
112
117
  when /mock/ then "rpm"
113
118
  when /dmg|apple/ then "dmg"
114
119
  when /gem/ then "gem"
@@ -21,33 +21,46 @@ if @build.build_pe
21
21
  # created for this specific deb ship. This enables us to escape the conflicts
22
22
  # introduced with simultaneous deb ships.
23
23
  #
24
- unless target_path
25
- puts "Creating temporary incoming dir on #{@build.apt_host}"
26
- target_path = %x{ssh -t #{@build.apt_host} 'mktemp -d -t incoming-XXXXXX'}.chomp
27
- end
28
24
 
29
- # For reprepro, we ship just the debs into an incoming dir. On the remote end,
30
- # reprepro will pull these debs in and add them to the repositories based on the
31
- # dist, e.g. lucid, architecture notwithstanding.
32
- #
33
- # The layout that the reprepro library will expect is:
34
- #
35
- # incoming_dir/{$dists}/*.deb
36
- #
37
- # ex:
38
- # incoming_dir|
39
- # |_lucid/*.deb
40
- # |_squeeze/*.deb
41
- # |_precise/*.deb
42
- # |_wheezy/*.deb
25
+ # We are going to iterate over every set of packages, adding them to
26
+ # the repository set by set. This enables us to handle different
27
+ # repositories per distribution. "pkg/pe/deb/" contains directories
28
+ # named for every distribution, e.g. "lucid," "squeeze," etc.
43
29
  #
44
- puts "Shipping PE debs to apt repo 'incoming' dir on #{@build.apt_host}"
45
- retry_on_fail(:times => 3) do
46
- cd "pkg/pe/deb" do
47
- Dir["**/*.deb"].each do |deb|
48
- rsync_to(deb, @build.apt_host, "#{target_path}/#{File.dirname(deb)}/")
30
+ Dir["pkg/pe/deb/*"].each do |dist|
31
+ dist = File.basename(dist)
32
+ unless target_path
33
+ puts "Creating temporary incoming dir on #{@build.apt_host}"
34
+ target_path = %x{ssh -t #{@build.apt_host} 'mktemp -d -t incoming-XXXXXX'}.chomp
35
+ end
36
+
37
+ # For reprepro, we ship just the debs into an incoming dir. On the remote end,
38
+ # reprepro will pull these debs in and add them to the repositories based on the
39
+ # dist, e.g. lucid, architecture notwithstanding.
40
+ #
41
+ # The layout that the reprepro library will expect is:
42
+ #
43
+ # incoming_dir/{$dists}/*.deb
44
+ #
45
+ # ex:
46
+ # incoming_dir|
47
+ # |_lucid/*.deb
48
+ # |_squeeze/*.deb
49
+ # |_precise/*.deb
50
+ # |_wheezy/*.deb
51
+ #
52
+ puts "Shipping PE debs to apt repo 'incoming' dir on #{@build.apt_host}"
53
+ retry_on_fail(:times => 3) do
54
+ Dir["pkg/pe/deb/#{dist}/*.deb"].each do |deb|
55
+ remote_ssh_cmd(@build.apt_host, "mkdir -p '#{target_path}/#{dist}'")
56
+ rsync_to(deb, @build.apt_host, "#{target_path}/#{dist}/#{File.basename(deb)}")
49
57
  end
50
58
  end
59
+
60
+ if @build.team == 'release'
61
+ Rake::Task["pe:remote:apt"].invoke(target_path, dist)
62
+ end
63
+
51
64
  end
52
65
 
53
66
  # We also ship our PE artifacts to directories for archival purposes and to
@@ -81,10 +94,18 @@ if @build.build_pe
81
94
  rsync_to("pkg/pe/deb/#{dist}/pe-*_#{arch}.deb --ignore-existing", @build.apt_host, "#{archive_path}/" )
82
95
  end
83
96
 
84
- # Ship all-arch debs to same place
97
+ # Ship all-arch debs to same dist-location, but to all known
98
+ # architectures for this distribution.
99
+ #
100
+ # I am not proud of this. MM - 1/3/2014.
101
+
85
102
  unless Dir["pkg/pe/deb/#{dist}/pe-*_all.deb"].empty?
86
- rsync_to("pkg/pe/deb/#{dist}/pe-*_all.deb --ignore-existing", @build.apt_host, "#{base_path}/#{dist}-i386/")
87
- rsync_to("pkg/pe/deb/#{dist}/pe-*_all.deb --ignore-existing", @build.apt_host, "#{base_path}/#{dist}-amd64/")
103
+ if dist =~ /cumulus/
104
+ rsync_to("pkg/pe/deb/#{dist}/pe-*_all.deb --ignore-existing", @build.apt_host, "#{base_path}/#{dist}-powerpc/")
105
+ else
106
+ rsync_to("pkg/pe/deb/#{dist}/pe-*_all.deb --ignore-existing", @build.apt_host, "#{base_path}/#{dist}-i386/")
107
+ rsync_to("pkg/pe/deb/#{dist}/pe-*_all.deb --ignore-existing", @build.apt_host, "#{base_path}/#{dist}-amd64/")
108
+ end
88
109
  end
89
110
 
90
111
  unless Dir["pkg/pe/deb/#{dist}/pe-*"].select { |i| i !~ /^.*\.deb$/ }.empty?
@@ -102,10 +123,6 @@ if @build.build_pe
102
123
  end
103
124
  end
104
125
 
105
-
106
- if @build.team == 'release'
107
- Rake::Task["pe:remote:apt"].invoke(target_path)
108
- end
109
126
  end
110
127
 
111
128
  namespace :remote do
@@ -121,14 +138,25 @@ if @build.build_pe
121
138
  # Per previous comments, the incoming directory must contain subdirectories named
122
139
  # for debian distributions.
123
140
  desc "Remotely add shipped packages to apt repo on #{@build.apt_host}"
124
- task :apt, :incoming do |t, args|
141
+ task :apt, :incoming, :dist do |t, args|
142
+ dist = args.dist
143
+ if dist =~ /cumulus/
144
+ reprepro_confdir = "/etc/reprepro/networking/#{@build.pe_version}/cumulus"
145
+ reprepro_basedir = "/opt/enterprise/networking/#{@build.pe_version}/cumulus"
146
+ reprepro_dbdir = "/var/lib/reprepro/networking/#{@build.pe_version}/cumulus"
147
+ else
148
+ reprepro_confdir = "/etc/reprepro/#{@build.pe_version}"
149
+ reprepro_basedir = "#{@build.apt_repo_path}/#{@build.pe_version}/repos/debian"
150
+ reprepro_dbdir = "/var/lib/reprepro/#{@build.pe_version}"
151
+ end
152
+
125
153
  incoming_dir = args.incoming
126
154
  incoming_dir or fail "Adding packages to apt repo requires an incoming directory"
127
155
  invoke_task("pl:fetch")
128
156
  remote_ssh_cmd(@build.apt_host, "/usr/bin/repsimple add_all \
129
- --confdir /etc/reprepro/#{@build.pe_version} \
130
- --basedir #{@build.apt_repo_path}/#{@build.pe_version}/repos/debian \
131
- --databasedir /var/lib/reprepro/#{@build.pe_version} \
157
+ --confdir #{reprepro_confdir} \
158
+ --basedir #{reprepro_basedir} \
159
+ --databasedir #{reprepro_dbdir} \
132
160
  --incomingdir #{incoming_dir}")
133
161
 
134
162
  puts "Cleaning up apt repo 'incoming' dir on #{@build.apt_host}"
@@ -4,9 +4,11 @@ namespace :pl do
4
4
  ["el", "fedora"].each do |dist|
5
5
  retry_on_fail(:times => 3) do
6
6
  pkgs = Dir["pkg/#{dist}/**/*.rpm"].map { |f| "'#{f.gsub("pkg/#{dist}/", "#{@build.yum_repo_path}/#{dist}/")}'"}
7
- rsync_to("pkg/#{dist}", @build.yum_host, @build.yum_repo_path)
8
- remote_set_immutable(@build.yum_host, pkgs)
9
- end
7
+ unless pkgs.empty?
8
+ rsync_to("pkg/#{dist}", @build.yum_host, @build.yum_repo_path)
9
+ remote_set_immutable(@build.yum_host, pkgs)
10
+ end
11
+ end if File.directory?("pkg/#{dist}")
10
12
  end
11
13
  end
12
14
 
@@ -37,7 +39,9 @@ namespace :pl do
37
39
  desc "Ship cow-built debs to #{@build.apt_host}"
38
40
  task :ship_debs do
39
41
  retry_on_fail(:times => 3) do
40
- rsync_to('pkg/deb/', @build.apt_host, @build.apt_repo_path)
42
+ if File.directory?("pkg/deb")
43
+ rsync_to('pkg/deb/', @build.apt_host, @build.apt_repo_path)
44
+ end
41
45
  end
42
46
  end
43
47
 
@@ -55,7 +55,13 @@ pl:jenkins:uber_build NOTIFY=foo@puppetlabs.com
55
55
  <properties>
56
56
  <jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty plugin="groovy-label-assignment@1.0.0">
57
57
  <groovyScript>def labelMap = [
58
- <% @build.cows.split(' ').each do |cow| %>&quot;pl_deb COW=<%= cow %>&quot;: &quot;deb&quot;,<% end %>
58
+ <% @build.cows.split(' ').each do |cow| %>
59
+ <% if cow =~ /cumulus/ %>
60
+ &quot;pl_deb COW=<%= cow %>&quot;: &quot;cumulus&quot;,
61
+ <% else %>
62
+ &quot;pl_deb COW=<%= cow %>&quot;: &quot;deb&quot;,
63
+ <% end %>
64
+ <% end %>
59
65
  <% @build.final_mocks.split(' ').each do |mock| %>&quot;pl_mock MOCK=<%= mock %>&quot;: &quot;rpm&quot;,<% end %>
60
66
  &quot;package_tar&quot;: &quot;rpm&quot;,
61
67
  <% if @build.build_gem then %>&quot;package_gem&quot;: &quot;gem&quot;,<% end %>
@@ -736,10 +736,8 @@ Puppet::Type.newtype(:file) do
736
736
  def write(property)
737
737
  remove_existing(:file)
738
738
 
739
- assumed_default_mode = 0644
740
-
741
739
  mode = self.should(:mode) # might be nil
742
- mode_int = mode ? symbolic_mode_to_int(mode, assumed_default_mode) : nil
740
+ mode_int = mode ? symbolic_mode_to_int(mode, Puppet::Util::DEFAULT_POSIX_MODE) : nil
743
741
 
744
742
  if write_temporary_file?
745
743
  Puppet::Util.replace_file(self[:path], mode_int) do |file|
data/lib/puppet/util.rb CHANGED
@@ -538,9 +538,21 @@ module Util
538
538
  # The default_mode is the mode to use when the target file doesn't already
539
539
  # exist; if the file is present we copy the existing mode/owner/group values
540
540
  # across.
541
+
542
+ DEFAULT_POSIX_MODE = 0644
543
+ DEFAULT_WINDOWS_MODE = nil
544
+
541
545
  def replace_file(file, default_mode, &block)
542
546
  raise Puppet::DevError, "replace_file requires a block" unless block_given?
543
547
 
548
+ unless default_mode
549
+ if Puppet.features.microsoft_windows?
550
+ default_mode = DEFAULT_WINDOWS_MODE
551
+ else
552
+ default_mode = DEFAULT_POSIX_MODE
553
+ end
554
+ end
555
+
544
556
  file = Pathname(file)
545
557
  tempfile = Tempfile.new(file.basename.to_s, file.dirname.to_s)
546
558
 
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
  #
8
8
  module Puppet
9
- PUPPETVERSION = '2.7.24'
9
+ PUPPETVERSION = '2.7.25'
10
10
 
11
11
  def self.version
12
12
  @puppet_version || PUPPETVERSION
@@ -1148,6 +1148,73 @@ describe Puppet::Type.type(:file) do
1148
1148
  expect { file.write :NOTUSED }.to_not raise_error(Puppet::Error)
1149
1149
  end
1150
1150
  end
1151
+
1152
+ describe "when resource mode is supplied" do
1153
+ before { file.stubs(:property_fix) }
1154
+
1155
+ context "and writing temporary files" do
1156
+ before { file.stubs(:write_temporary_file?).returns(true) }
1157
+
1158
+ it "should convert symbolic mode to int" do
1159
+ file[:mode] = 'oga=r'
1160
+ Puppet::Util.expects(:replace_file).with(file[:path], 0444)
1161
+ file.write :NOTUSED
1162
+ end
1163
+
1164
+ it "should support int modes" do
1165
+ file[:mode] = '0444'
1166
+ Puppet::Util.expects(:replace_file).with(file[:path], 0444)
1167
+ file.write :NOTUSED
1168
+ end
1169
+ end
1170
+
1171
+ context "and not writing temporary files" do
1172
+ before { file.stubs(:write_temporary_file?).returns(false) }
1173
+
1174
+ it "should set a umask of 0" do
1175
+ file[:mode] = 'oga=r'
1176
+ Puppet::Util.expects(:withumask).with(0)
1177
+ file.write :NOTUSED
1178
+ end
1179
+
1180
+ it "should convert symbolic mode to int" do
1181
+ file[:mode] = 'oga=r'
1182
+ File.expects(:open).with(file[:path], anything, 0444)
1183
+ file.write :NOTUSED
1184
+ end
1185
+
1186
+ it "should support int modes" do
1187
+ file[:mode] = '0444'
1188
+ File.expects(:open).with(file[:path], anything, 0444)
1189
+ file.write :NOTUSED
1190
+ end
1191
+ end
1192
+ end
1193
+
1194
+ describe "when resource mode is not supplied" do
1195
+ context "and content is supplied" do
1196
+ it "should default to 0644 mode" do
1197
+ file = described_class.new(:path => path, :content => "file content")
1198
+
1199
+ file.write :NOTUSED
1200
+
1201
+ expect(File.stat(file[:path]).mode & 0777).to eq(0644)
1202
+ end
1203
+ end
1204
+
1205
+ context "and no content is supplied" do
1206
+ it "should use puppet's default umask of 022" do
1207
+ file = described_class.new(:path => path)
1208
+
1209
+ umask_from_the_user = 0777
1210
+ Puppet::Util.withumask(umask_from_the_user) do
1211
+ file.write :NOTUSED
1212
+ end
1213
+
1214
+ expect(File.stat(file[:path]).mode & 0777).to eq(0644)
1215
+ end
1216
+ end
1217
+ end
1151
1218
  end
1152
1219
 
1153
1220
  describe "#fail_if_checksum_is_wrong" do
metadata CHANGED
@@ -1,50 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
- version: !ruby/object:Gem::Version
4
- hash: 35
5
- prerelease: false
6
- segments:
7
- - 2
8
- - 7
9
- - 24
10
- version: 2.7.24
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.7.25
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Puppet Labs
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-12-26 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2014-01-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: facter
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 5
30
- segments:
31
- - 1
32
- - 5
33
- version: "1.5"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.5'
34
22
  type: :runtime
35
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.5'
36
30
  description: Puppet, an automated configuration management tool
37
31
  email: puppet@puppetlabs.com
38
- executables:
32
+ executables:
39
33
  - filebucket
40
34
  - pi
41
35
  - puppet
42
- - puppetca
43
- - puppetd
44
36
  - puppetdoc
45
- - puppetmasterd
46
- - puppetqd
47
- - puppetrun
48
37
  - ralsh
49
38
  - puppetca
50
39
  - puppetd
@@ -52,10 +41,8 @@ executables:
52
41
  - puppetqd
53
42
  - puppetrun
54
43
  extensions: []
55
-
56
44
  extra_rdoc_files: []
57
-
58
- files:
45
+ files:
59
46
  - CHANGELOG
60
47
  - CONTRIBUTING.md
61
48
  - Gemfile
@@ -67,12 +54,7 @@ files:
67
54
  - bin/filebucket
68
55
  - bin/pi
69
56
  - bin/puppet
70
- - bin/puppetca
71
- - bin/puppetd
72
57
  - bin/puppetdoc
73
- - bin/puppetmasterd
74
- - bin/puppetqd
75
- - bin/puppetrun
76
58
  - bin/ralsh
77
59
  - lib/puppet.rb
78
60
  - lib/puppet/agent.rb
@@ -2030,43 +2012,38 @@ files:
2030
2012
  - spec/unit/util/zaml_spec.rb
2031
2013
  - spec/unit/util_spec.rb
2032
2014
  - spec/watchr.rb
2033
- has_rdoc: true
2015
+ - bin/puppetca
2016
+ - bin/puppetd
2017
+ - bin/puppetmasterd
2018
+ - bin/puppetqd
2019
+ - bin/puppetrun
2034
2020
  homepage: http://puppetlabs.com
2035
2021
  licenses: []
2036
-
2037
2022
  post_install_message:
2038
- rdoc_options:
2023
+ rdoc_options:
2039
2024
  - --title
2040
2025
  - Puppet - Configuration Management
2041
2026
  - --main
2042
2027
  - README
2043
2028
  - --line-numbers
2044
- require_paths:
2029
+ require_paths:
2045
2030
  - lib
2046
- required_ruby_version: !ruby/object:Gem::Requirement
2031
+ required_ruby_version: !ruby/object:Gem::Requirement
2047
2032
  none: false
2048
- requirements:
2049
- - - ">="
2050
- - !ruby/object:Gem::Version
2051
- hash: 3
2052
- segments:
2053
- - 0
2054
- version: "0"
2055
- required_rubygems_version: !ruby/object:Gem::Requirement
2033
+ requirements:
2034
+ - - ! '>='
2035
+ - !ruby/object:Gem::Version
2036
+ version: '0'
2037
+ required_rubygems_version: !ruby/object:Gem::Requirement
2056
2038
  none: false
2057
- requirements:
2058
- - - ">="
2059
- - !ruby/object:Gem::Version
2060
- hash: 3
2061
- segments:
2062
- - 0
2063
- version: "0"
2039
+ requirements:
2040
+ - - ! '>='
2041
+ - !ruby/object:Gem::Version
2042
+ version: '0'
2064
2043
  requirements: []
2065
-
2066
2044
  rubyforge_project: puppet
2067
- rubygems_version: 1.3.7
2045
+ rubygems_version: 1.8.25
2068
2046
  signing_key:
2069
2047
  specification_version: 3
2070
2048
  summary: Puppet, an automated configuration management tool
2071
2049
  test_files: []
2072
-