r10k 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.mkd CHANGED
@@ -1,6 +1,43 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 1.4.2
5
+ -----
6
+
7
+ 2015/03/13
8
+
9
+ ### Announcements
10
+
11
+ The r10k ticket tracker is moving to the Puppet Labs issue tracker; new issues
12
+ should be filed on the [R10K project](https://tickets.puppetlabs.com/browse/RK).
13
+ The GitHub issue tracker will remain online for the near future but is
14
+ deprecated in favor of JIRA. Issues from the GitHub tracker will be prefixed
15
+ with "GH-"; issues from JIRA will be prefixed with "RK-".
16
+
17
+ ### User notes
18
+
19
+ (RK-4) Raise meaningful errors on missing sources
20
+
21
+ If the 'sources' key in r10k.yaml was left unset, was misspelled, or was empty,
22
+ r10k try to blindly iterate through it as a hash and would subsequently raise an
23
+ error. This has been remedied so that if the value is missing or empty an error
24
+ will be raised.
25
+
26
+ Note that this doesn't handle the case where r10k.yaml is empty or malformed;
27
+ that issue is being tracked as RK-34.
28
+
29
+ (GH-310, RK-36) `r10k deploy display -p --detail` fails on Ruby 1.8.7
30
+
31
+ Ruby 1.8.7 does not implement the comparison operator on Symbols, which was
32
+ being used by the display command to ensure that hashes were printed in a
33
+ consistent order. This has been fixed by backporting the Ruby 1.9 Symbol sorting
34
+ to 1.8.7.
35
+
36
+ ### Thanks
37
+
38
+ Thanks to [Eli Young](https://github.com/elyscape) for reviewing PR 337 and
39
+ providing helpful feedback.
40
+
4
41
  1.4.1
5
42
  -----
6
43
 
@@ -1,3 +1,4 @@
1
+ require 'r10k/util/monkey_patches'
1
2
  require 'r10k/util/setopts'
2
3
  require 'r10k/deployment'
3
4
  require 'r10k/logging'
@@ -114,6 +114,9 @@ module R10K
114
114
 
115
115
  def load_sources
116
116
  sources = @config.setting(:sources)
117
+ if sources.nil? || sources.empty?
118
+ raise R10K::Error, "'sources' key in #{@config.configfile} missing or empty."
119
+ end
117
120
  @_sources = sources.map do |(name, hash)|
118
121
  R10K::Source.from_hash(name, hash)
119
122
  end
@@ -0,0 +1,11 @@
1
+ if !Symbol.instance_methods.include?(:<=>)
2
+ class Symbol
3
+ # Ruby 1.8.7 does not define #<=>, which subsequently breaks Enumerable#sort
4
+ # when sorting an array of symbols.
5
+ #
6
+ # @see https://github.com/puppetlabs/r10k/issues/310
7
+ def <=>(other)
8
+ self.to_s <=> other.to_s if other.is_a?(Symbol)
9
+ end
10
+ end
11
+ end
data/lib/r10k/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
  end
@@ -7,6 +7,10 @@ module R10K
7
7
  @hash = hash
8
8
  end
9
9
 
10
+ def configfile
11
+ "/some/nonexistent/config_file"
12
+ end
13
+
10
14
  # Perform a scan for key and check for both string and symbol keys
11
15
  def setting(key)
12
16
  keys = [key]
@@ -140,3 +140,23 @@ describe R10K::Deployment, "with environment collisions" do
140
140
  }.to raise_error(R10K::R10KError, /Environment collision at .* between s\d:third and s\d:third/)
141
141
  end
142
142
  end
143
+
144
+ describe R10K::Deployment, "checking the 'sources' key" do
145
+
146
+ {
147
+ "when missing" => {},
148
+ "when empty" => {:sources => []},
149
+ }.each_pair do |desc, config_hash|
150
+ describe desc do
151
+
152
+ let(:config) { R10K::Deployment::MockConfig.new(config_hash) }
153
+ subject(:deployment) { described_class.new(config) }
154
+
155
+ it "raises an error when enumerating sources" do
156
+ expect {
157
+ deployment.sources
158
+ }.to raise_error(R10K::Error, "'sources' key in /some/nonexistent/config_file missing or empty.")
159
+ end
160
+ end
161
+ end
162
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+ require 'r10k/util/monkey_patches'
3
+
4
+ describe Symbol, "comparison operator", :if => RUBY_VERSION == '1.8.7' do
5
+ it "returns nil if the other value is incomparable" do
6
+ expect(:aaa <=> 'bbb').to be_nil
7
+ end
8
+
9
+ it "returns -1 if the value sorts lower than the compared value" do
10
+ expect(:aaa <=> :bbb).to eq(-1)
11
+ end
12
+
13
+ it "returns 0 if the values are equal" do
14
+ expect(:aaa <=> :aaa).to eq(0)
15
+ end
16
+
17
+ it "returns 1 if the value sorts higher than the compared value" do
18
+ expect(:bbb <=> :aaa).to eq(1)
19
+ end
20
+ end
metadata CHANGED
@@ -1,187 +1,211 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Adrien Thebo
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-01-10 00:00:00.000000000 Z
12
+ date: 2015-03-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: colored
15
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - '='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.2'
20
- requirement: !ruby/object:Gem::Requirement
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
21
26
  requirements:
22
27
  - - '='
23
28
  - !ruby/object:Gem::Version
24
29
  version: '1.2'
25
- prerelease: false
26
- type: :runtime
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: cri
29
- version_requirements: !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: 2.6.1
34
- requirement: !ruby/object:Gem::Requirement
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
35
42
  requirements:
36
43
  - - ~>
37
44
  - !ruby/object:Gem::Version
38
45
  version: 2.6.1
39
- prerelease: false
40
- type: :runtime
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: systemu
43
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
47
53
  version: 2.5.2
48
- requirement: !ruby/object:Gem::Requirement
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
49
58
  requirements:
50
59
  - - ~>
51
60
  - !ruby/object:Gem::Version
52
61
  version: 2.5.2
53
- prerelease: false
54
- type: :runtime
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: log4r
57
- version_requirements: !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - '='
60
68
  - !ruby/object:Gem::Version
61
69
  version: 1.1.10
62
- requirement: !ruby/object:Gem::Requirement
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
63
74
  requirements:
64
75
  - - '='
65
76
  - !ruby/object:Gem::Version
66
77
  version: 1.1.10
67
- prerelease: false
68
- type: :runtime
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: multi_json
71
- version_requirements: !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
75
85
  version: 1.8.2
76
- requirement: !ruby/object:Gem::Requirement
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
77
90
  requirements:
78
91
  - - ~>
79
92
  - !ruby/object:Gem::Version
80
93
  version: 1.8.2
81
- prerelease: false
82
- type: :runtime
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: json_pure
85
- version_requirements: !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: '1.8'
90
- requirement: !ruby/object:Gem::Requirement
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
91
106
  requirements:
92
107
  - - ~>
93
108
  - !ruby/object:Gem::Version
94
109
  version: '1.8'
95
- prerelease: false
96
- type: :runtime
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: faraday
99
- version_requirements: !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: 0.8.8
104
- requirement: !ruby/object:Gem::Requirement
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
105
122
  requirements:
106
123
  - - ~>
107
124
  - !ruby/object:Gem::Version
108
125
  version: 0.8.8
109
- prerelease: false
110
- type: :runtime
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: faraday_middleware
113
- version_requirements: !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - ~>
116
132
  - !ruby/object:Gem::Version
117
133
  version: 0.9.0
118
- requirement: !ruby/object:Gem::Requirement
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
119
138
  requirements:
120
139
  - - ~>
121
140
  - !ruby/object:Gem::Version
122
141
  version: 0.9.0
123
- prerelease: false
124
- type: :runtime
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: faraday_middleware-multi_json
127
- version_requirements: !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - ~>
130
148
  - !ruby/object:Gem::Version
131
149
  version: 0.0.5
132
- requirement: !ruby/object:Gem::Requirement
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
133
154
  requirements:
134
155
  - - ~>
135
156
  - !ruby/object:Gem::Version
136
157
  version: 0.0.5
137
- prerelease: false
138
- type: :runtime
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: rspec
141
- version_requirements: !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
163
  - - ~>
144
164
  - !ruby/object:Gem::Version
145
165
  version: '3.1'
146
- requirement: !ruby/object:Gem::Requirement
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
147
170
  requirements:
148
171
  - - ~>
149
172
  - !ruby/object:Gem::Version
150
173
  version: '3.1'
151
- prerelease: false
152
- type: :development
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: vcr
155
- version_requirements: !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
179
  - - ~>
158
180
  - !ruby/object:Gem::Version
159
181
  version: '2.9'
160
- requirement: !ruby/object:Gem::Requirement
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
161
186
  requirements:
162
187
  - - ~>
163
188
  - !ruby/object:Gem::Version
164
189
  version: '2.9'
165
- prerelease: false
166
- type: :development
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: yard
169
- version_requirements: !ruby/object:Gem::Requirement
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
195
  - - ~>
172
196
  - !ruby/object:Gem::Version
173
197
  version: 0.8.7.3
174
- requirement: !ruby/object:Gem::Requirement
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
175
202
  requirements:
176
203
  - - ~>
177
204
  - !ruby/object:Gem::Version
178
205
  version: 0.8.7.3
179
- prerelease: false
180
- type: :development
181
- description: |2
182
- R10K provides a general purpose toolset for deploying Puppet environments and modules.
183
- It implements the Puppetfile format and provides a native implementation of Puppet
184
- dynamic environments.
206
+ description: ! " R10K provides a general purpose toolset for deploying Puppet environments
207
+ and modules.\n It implements the Puppetfile format and provides a native implementation
208
+ of Puppet\n dynamic environments.\n"
185
209
  email: adrien@somethingsinistral.net
186
210
  executables:
187
211
  - r10k
@@ -292,6 +316,7 @@ files:
292
316
  - lib/r10k/util/attempt.rb
293
317
  - lib/r10k/util/basedir.rb
294
318
  - lib/r10k/util/core_ext/hash_ext.rb
319
+ - lib/r10k/util/monkey_patches.rb
295
320
  - lib/r10k/util/platform.rb
296
321
  - lib/r10k/util/purgeable.rb
297
322
  - lib/r10k/util/setopts.rb
@@ -365,6 +390,7 @@ files:
365
390
  - spec/unit/svn/working_dir_spec.rb
366
391
  - spec/unit/util/attempt_spec.rb
367
392
  - spec/unit/util/core_ext/hash_ext_spec.rb
393
+ - spec/unit/util/monkey_patches_spec.rb
368
394
  - spec/unit/util/setopts_spec.rb
369
395
  - spec/unit/util/subprocess/result_spec.rb
370
396
  - spec/unit/util/subprocess/subprocess_error_spec.rb
@@ -372,37 +398,33 @@ files:
372
398
  homepage: http://github.com/adrienthebo/r10k
373
399
  licenses:
374
400
  - Apache-2.0
375
- metadata: {}
376
- post_install_message:
401
+ post_install_message:
377
402
  rdoc_options: []
378
403
  require_paths:
379
404
  - lib
380
405
  required_ruby_version: !ruby/object:Gem::Requirement
406
+ none: false
381
407
  requirements:
382
- - - '>='
408
+ - - ! '>='
383
409
  - !ruby/object:Gem::Version
384
410
  version: '0'
385
411
  required_rubygems_version: !ruby/object:Gem::Requirement
412
+ none: false
386
413
  requirements:
387
- - - '>='
414
+ - - ! '>='
388
415
  - !ruby/object:Gem::Version
389
416
  version: '0'
390
417
  requirements: []
391
- rubyforge_project:
392
- rubygems_version: 2.1.9
393
- signing_key:
394
- specification_version: 4
418
+ rubyforge_project:
419
+ rubygems_version: 1.8.23.2
420
+ signing_key:
421
+ specification_version: 3
395
422
  summary: Puppet environment and module deployment
396
423
  test_files:
397
- - spec/unit/module_spec.rb
398
- - spec/unit/keyed_factory_spec.rb
399
- - spec/unit/source_spec.rb
400
- - spec/unit/puppetfile_spec.rb
401
- - spec/unit/instance_cache_spec.rb
402
- - spec/unit/deployment_spec.rb
403
424
  - spec/unit/environment/base_spec.rb
404
425
  - spec/unit/environment/svn_spec.rb
405
426
  - spec/unit/environment/git_spec.rb
427
+ - spec/unit/module_spec.rb
406
428
  - spec/unit/module_repository/forge_spec.rb
407
429
  - spec/unit/git/ref_spec.rb
408
430
  - spec/unit/git/working_dir_spec.rb
@@ -412,28 +434,34 @@ test_files:
412
434
  - spec/unit/git/head_spec.rb
413
435
  - spec/unit/git/alternates_spec.rb
414
436
  - spec/unit/git/tag_spec.rb
437
+ - spec/unit/keyed_factory_spec.rb
415
438
  - spec/unit/deployment/environment_spec.rb
416
439
  - spec/unit/deployment/source_spec.rb
440
+ - spec/unit/source_spec.rb
441
+ - spec/unit/puppetfile_spec.rb
442
+ - spec/unit/util/monkey_patches_spec.rb
417
443
  - spec/unit/util/attempt_spec.rb
418
444
  - spec/unit/util/setopts_spec.rb
419
- - spec/unit/util/subprocess_spec.rb
420
445
  - spec/unit/util/subprocess/result_spec.rb
421
446
  - spec/unit/util/subprocess/subprocess_error_spec.rb
447
+ - spec/unit/util/subprocess_spec.rb
422
448
  - spec/unit/util/core_ext/hash_ext_spec.rb
423
449
  - spec/unit/errors/formatting_spec.rb
450
+ - spec/unit/instance_cache_spec.rb
424
451
  - spec/unit/action/visitor_spec.rb
425
452
  - spec/unit/action/cri_runner_spec.rb
426
- - spec/unit/action/runner_spec.rb
427
453
  - spec/unit/action/puppetfile/cri_action_spec.rb
454
+ - spec/unit/action/runner_spec.rb
428
455
  - spec/unit/settings/container_spec.rb
429
456
  - spec/unit/svn/working_dir_spec.rb
430
457
  - spec/unit/svn/remote_spec.rb
431
458
  - spec/unit/source/base_spec.rb
432
459
  - spec/unit/source/svn_spec.rb
433
460
  - spec/unit/source/git_spec.rb
461
+ - spec/unit/deployment_spec.rb
434
462
  - spec/unit/module/forge_spec.rb
435
463
  - spec/unit/module/base_spec.rb
436
464
  - spec/unit/module/svn_spec.rb
437
465
  - spec/unit/module/git_spec.rb
438
466
  - spec/unit/module/metadata_spec.rb
439
- has_rdoc:
467
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 3617d49776218c02d2e1de1f3f40cb267897f1a7
4
- data.tar.gz: 668d68acdf49933248305d1c694637a29798b057
5
- SHA512:
6
- metadata.gz: 2e4f861e931a5c663e4315178bf17cc8ee61375634a9a1bef927ca23b2b2656caf18e37b56c2a889498a53c895c428a4a3901ee6a6cee61339cb1b544f455ebd
7
- data.tar.gz: a2f13cac9fe9c31fa604803fb6576f2945ecc5fe16da7c08388b0dbd853b905782694dc6884cd0a666e1d708607d84a086a5436f3fb7c7b3897e67e5b4d247f4