r10k 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YmQxYWU2Zjk4NzkwODMwNWYyZWMxMTA0NGZmMjg3NGFiNDM1OThlNA==
5
- data.tar.gz: !binary |-
6
- ZmRiYjU3NDk4ZTA0ZDdiYTYxMDc4YTU2ZTg4MzQ5MjFkYjNmZjVlNw==
2
+ SHA1:
3
+ metadata.gz: 3617d49776218c02d2e1de1f3f40cb267897f1a7
4
+ data.tar.gz: 668d68acdf49933248305d1c694637a29798b057
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjE4YmM1ZmFlNDA1NWVkODYwMGU4YzQzYjk2OTNhOWY0ZWIwMjFkYjZmZmFk
10
- ZWE3ZTA1MzEzNzgxYzNhZmVhMmYzZTQ1YzUwNTRiMTQ1NWU4MmRhMWM4ODBk
11
- YWMzMDE3ZmRiYWQzNDA0MzhmNjk0ZTBlYzBkNDdjN2IwYjJmMGM=
12
- data.tar.gz: !binary |-
13
- MjNiNGJhYmQ1YWNlYjc0MzVhZWNmYzUwNjM2ZWEwMzcwYjZjYjA3OGRhOTAw
14
- ZDk4MTQ2ZjlmMWQ5ZDBjNzdiY2RjNjVmY2JiOWQ5MGVmNjRmNjliNWEzNjkx
15
- YTQ4YjI1ZWYwZmE1ZTk2NWZiOTczNTUwZTA2OWRiNGZmMmM1NzM=
6
+ metadata.gz: 2e4f861e931a5c663e4315178bf17cc8ee61375634a9a1bef927ca23b2b2656caf18e37b56c2a889498a53c895c428a4a3901ee6a6cee61339cb1b544f455ebd
7
+ data.tar.gz: a2f13cac9fe9c31fa604803fb6576f2945ecc5fe16da7c08388b0dbd853b905782694dc6884cd0a666e1d708607d84a086a5436f3fb7c7b3897e67e5b4d247f4
data/CHANGELOG.mkd CHANGED
@@ -1,6 +1,59 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 1.4.1
5
+ -----
6
+
7
+ 2015/01/09
8
+
9
+ ### User notes
10
+
11
+ (GH-254) Puppetfile subcommands use non-zero exit codes on errors.
12
+
13
+ The Puppetfile `install` and `purge` commands would always exit with an exit
14
+ code of 0, regardless of if any errors occurred or if there was no Puppetfile
15
+ available. This has been now corrected so that runtime errors cause r10k to exit
16
+ with a non-zero exit code.
17
+
18
+ (GH-260) Normalize deployed environment names on the command line.
19
+
20
+ Version 1.4.0 removed the environment name normalization needed to deploy
21
+ environments that had their directory names normalized; this has been remedied
22
+ so that environment names on the command line are also normalized to match the
23
+ corrections that r10k will make to the environment names.
24
+
25
+ (GH-269) Improved error messages when trying to use non-existent Git refs.
26
+
27
+ If a Git module tried to use a Git ref that did not exist, it would output a
28
+ particularly unhelpful error message that didn't indicate what actually failed.
29
+ This has been fixed so that if an invalid ref is used, r10k will actually report
30
+ that the ref could not be used. What a brave new world we inhabit!
31
+
32
+ (GH-271)/(GH-275) Report the name of invalid module names.
33
+
34
+ The fix for GH-92 released in 1.4.0 added better handling and parsing of module
35
+ names, but also added stricter parsing of module names and disallowed invalid
36
+ characters that Puppet itself could not use. However when r10k encountered such
37
+ an invalid module name, it would not report the module with the invalid name,
38
+ making debugging harder than needed. In 1.4.1 r10k when r10k encounters an
39
+ invalid module name it reports the invalid module name in the error message.
40
+
41
+ ### Thanks
42
+
43
+ Thanks to the following contributors for their work on this release:
44
+
45
+ * [Lex Rivera](https://github.com/rlex) for discovering and reporting the r10k
46
+ puppetfile exit code bug (GH-254).
47
+ * [Eli Young](https://github.com/elyscape) for discovering and fixing the
48
+ environment normalization bug (GH-260).
49
+ * [Clayton O'Neill](https://github.com/dvorak) For adding better error
50
+ reporting of invalid module names (GH-275).
51
+
52
+ Additional thanks to all those in #puppet and #r10k for endlessly helping new
53
+ users of r10k, your assistance is invaluable!
54
+
55
+ ###
56
+
4
57
  1.4.0
5
58
  -----
6
59
 
@@ -13,7 +13,7 @@ module R10K
13
13
 
14
14
  def initialize(opts, argv)
15
15
  @opts = opts
16
- @argv = argv
16
+ @argv = argv.map { |arg| arg.gsub(/\W/,'_') }
17
17
  setopts(opts, {
18
18
  :config => :self,
19
19
  :puppetfile => :self,
@@ -26,10 +26,10 @@ module R10K
26
26
  pf = R10K::Puppetfile.new(@root, @moduledir, @path)
27
27
 
28
28
  begin
29
- pf.load
29
+ pf.load!
30
30
  $stderr.puts "Syntax OK"
31
31
  true
32
- rescue R10K::Error => e
32
+ rescue => e
33
33
  $stderr.puts R10K::Errors::Formatting.format_exception(e, @trace)
34
34
  false
35
35
  end
@@ -38,7 +38,7 @@ module R10K
38
38
  end
39
39
 
40
40
  def visit_puppetfile(pf)
41
- pf.load
41
+ pf.load!
42
42
  yield
43
43
  pf.purge!
44
44
  end
@@ -24,11 +24,11 @@ module R10K
24
24
 
25
25
  def call
26
26
  pf = R10K::Puppetfile.new(@root, @moduledir, @path)
27
- pf.load
27
+ pf.load!
28
28
  pf.purge!
29
29
  true
30
30
  rescue => e
31
- logger.error R10K::Errors::Formatting.format_exception(e, opts[:trace])
31
+ logger.error R10K::Errors::Formatting.format_exception(e, @trace)
32
32
  false
33
33
  end
34
34
  end
@@ -10,31 +10,17 @@ module R10K
10
10
  attr_reader :ref
11
11
  attr_reader :git_dir
12
12
 
13
- def initialize(*args)
13
+ def initialize(mesg, options = {})
14
14
  super
15
-
16
- @hash = @options[:ref]
15
+ @ref = @options[:ref]
17
16
  @git_dir = @options[:git_dir]
18
17
  end
19
18
 
20
- HASHLIKE = %r[[A-Fa-f0-9]]
21
-
22
- # Print a friendly error message if an object hash is given as the message
23
19
  def message
24
- if @mesg
25
- msg = @mesg
26
- else
27
- msg = "Could not locate hash"
28
-
29
- if @hash
30
- msg << " '#{@hash}'"
31
- end
32
- end
33
-
20
+ msg = super
34
21
  if @git_dir
35
22
  msg << " at #{@git_dir}"
36
23
  end
37
-
38
24
  msg
39
25
  end
40
26
  end
@@ -38,7 +38,7 @@ class R10K::Git::Repository
38
38
  if commit
39
39
  commit.chomp
40
40
  else
41
- raise R10K::Git::UnresolvableRefError.new(:ref => pattern, :git_dir => git_dir)
41
+ raise R10K::Git::UnresolvableRefError.new("Could not resolve Git ref '#{ref}'", :ref => pattern, :git_dir => git_dir)
42
42
  end
43
43
  end
44
44
  alias rev_parse resolve_ref
@@ -89,13 +89,9 @@ class R10K::Git::WorkingDir < R10K::Git::Repository
89
89
  #
90
90
  # @param ref [R10K::Git::Ref] The git reference to check out
91
91
  def checkout(ref)
92
- if ref.resolvable?
93
- git ["checkout", "--force", @ref.sha1], :path => @full_path
94
- else
95
- raise R10K::Git::UnresolvableRefError.new(
96
- "Cannot check out unresolvable ref '#{@ref}'",
97
- :git_dir => @full_path)
98
- end
92
+ git ["checkout", "--force", @ref.sha1], :path => @full_path
93
+ rescue => e
94
+ raise R10K::Git::GitError.wrap(e, "Cannot check out Git ref '#{@ref}'")
99
95
  end
100
96
 
101
97
  # The currently checked out HEAD
@@ -96,7 +96,7 @@ class R10K::Module::Base
96
96
  elsif (match = title.match(/\A(\w+)[-\/](\w+)\Z/))
97
97
  [match[1], match[2]]
98
98
  else
99
- raise ArgumentError, "Module names must match either 'modulename' or 'owner/modulename'"
99
+ raise ArgumentError, "Module name (#{title}) must match either 'modulename' or 'owner/modulename'"
100
100
  end
101
101
  end
102
102
  end
data/lib/r10k/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -24,7 +24,7 @@ describe R10K::Module::Base do
24
24
  it "raises an error when the title is not correctly formatted" do
25
25
  expect {
26
26
  described_class.new('branan!eight_hundred', '/moduledir', [])
27
- }.to raise_error(ArgumentError, "Module names must match either 'modulename' or 'owner/modulename'")
27
+ }.to raise_error(ArgumentError, "Module name (branan!eight_hundred) must match either 'modulename' or 'owner/modulename'")
28
28
  end
29
29
  end
30
30
 
metadata CHANGED
@@ -1,186 +1,187 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2015-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
15
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - '='
25
23
  - !ruby/object:Gem::Version
26
24
  version: '1.2'
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cri
29
- requirement: !ruby/object:Gem::Requirement
29
+ version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.6.1
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
37
35
  requirements:
38
36
  - - ~>
39
37
  - !ruby/object:Gem::Version
40
38
  version: 2.6.1
39
+ prerelease: false
40
+ type: :runtime
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: systemu
43
- requirement: !ruby/object:Gem::Requirement
43
+ version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.5.2
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
51
49
  requirements:
52
50
  - - ~>
53
51
  - !ruby/object:Gem::Version
54
52
  version: 2.5.2
53
+ prerelease: false
54
+ type: :runtime
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: log4r
57
- requirement: !ruby/object:Gem::Requirement
57
+ version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.1.10
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
62
+ requirement: !ruby/object:Gem::Requirement
65
63
  requirements:
66
64
  - - '='
67
65
  - !ruby/object:Gem::Version
68
66
  version: 1.1.10
67
+ prerelease: false
68
+ type: :runtime
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: multi_json
71
- requirement: !ruby/object:Gem::Requirement
71
+ version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.8.2
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
76
+ requirement: !ruby/object:Gem::Requirement
79
77
  requirements:
80
78
  - - ~>
81
79
  - !ruby/object:Gem::Version
82
80
  version: 1.8.2
81
+ prerelease: false
82
+ type: :runtime
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json_pure
85
- requirement: !ruby/object:Gem::Requirement
85
+ version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.8'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
90
+ requirement: !ruby/object:Gem::Requirement
93
91
  requirements:
94
92
  - - ~>
95
93
  - !ruby/object:Gem::Version
96
94
  version: '1.8'
95
+ prerelease: false
96
+ type: :runtime
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: faraday
99
- requirement: !ruby/object:Gem::Requirement
99
+ version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: 0.8.8
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
104
+ requirement: !ruby/object:Gem::Requirement
107
105
  requirements:
108
106
  - - ~>
109
107
  - !ruby/object:Gem::Version
110
108
  version: 0.8.8
109
+ prerelease: false
110
+ type: :runtime
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: faraday_middleware
113
- requirement: !ruby/object:Gem::Requirement
113
+ version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 0.9.0
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
118
+ requirement: !ruby/object:Gem::Requirement
121
119
  requirements:
122
120
  - - ~>
123
121
  - !ruby/object:Gem::Version
124
122
  version: 0.9.0
123
+ prerelease: false
124
+ type: :runtime
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: faraday_middleware-multi_json
127
- requirement: !ruby/object:Gem::Requirement
127
+ version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: 0.0.5
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
132
+ requirement: !ruby/object:Gem::Requirement
135
133
  requirements:
136
134
  - - ~>
137
135
  - !ruby/object:Gem::Version
138
136
  version: 0.0.5
137
+ prerelease: false
138
+ type: :runtime
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
- requirement: !ruby/object:Gem::Requirement
141
+ version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: '3.1'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
146
+ requirement: !ruby/object:Gem::Requirement
149
147
  requirements:
150
148
  - - ~>
151
149
  - !ruby/object:Gem::Version
152
150
  version: '3.1'
151
+ prerelease: false
152
+ type: :development
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: vcr
155
- requirement: !ruby/object:Gem::Requirement
155
+ version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: '2.9'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
163
161
  requirements:
164
162
  - - ~>
165
163
  - !ruby/object:Gem::Version
166
164
  version: '2.9'
165
+ prerelease: false
166
+ type: :development
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
- requirement: !ruby/object:Gem::Requirement
169
+ version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
173
  version: 0.8.7.3
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
174
+ requirement: !ruby/object:Gem::Requirement
177
175
  requirements:
178
176
  - - ~>
179
177
  - !ruby/object:Gem::Version
180
178
  version: 0.8.7.3
181
- description: ! " R10K provides a general purpose toolset for deploying Puppet environments
182
- and modules.\n It implements the Puppetfile format and provides a native implementation
183
- of Puppet\n dynamic environments.\n"
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.
184
185
  email: adrien@somethingsinistral.net
185
186
  executables:
186
187
  - r10k
@@ -372,31 +373,36 @@ homepage: http://github.com/adrienthebo/r10k
372
373
  licenses:
373
374
  - Apache-2.0
374
375
  metadata: {}
375
- post_install_message:
376
+ post_install_message:
376
377
  rdoc_options: []
377
378
  require_paths:
378
379
  - lib
379
380
  required_ruby_version: !ruby/object:Gem::Requirement
380
381
  requirements:
381
- - - ! '>='
382
+ - - '>='
382
383
  - !ruby/object:Gem::Version
383
384
  version: '0'
384
385
  required_rubygems_version: !ruby/object:Gem::Requirement
385
386
  requirements:
386
- - - ! '>='
387
+ - - '>='
387
388
  - !ruby/object:Gem::Version
388
389
  version: '0'
389
390
  requirements: []
390
- rubyforge_project:
391
- rubygems_version: 2.4.4
392
- signing_key:
391
+ rubyforge_project:
392
+ rubygems_version: 2.1.9
393
+ signing_key:
393
394
  specification_version: 4
394
395
  summary: Puppet environment and module deployment
395
396
  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
396
403
  - spec/unit/environment/base_spec.rb
397
404
  - spec/unit/environment/svn_spec.rb
398
405
  - spec/unit/environment/git_spec.rb
399
- - spec/unit/module_spec.rb
400
406
  - spec/unit/module_repository/forge_spec.rb
401
407
  - spec/unit/git/ref_spec.rb
402
408
  - spec/unit/git/working_dir_spec.rb
@@ -406,33 +412,28 @@ test_files:
406
412
  - spec/unit/git/head_spec.rb
407
413
  - spec/unit/git/alternates_spec.rb
408
414
  - spec/unit/git/tag_spec.rb
409
- - spec/unit/keyed_factory_spec.rb
410
415
  - spec/unit/deployment/environment_spec.rb
411
416
  - spec/unit/deployment/source_spec.rb
412
- - spec/unit/source_spec.rb
413
- - spec/unit/puppetfile_spec.rb
414
417
  - spec/unit/util/attempt_spec.rb
415
418
  - spec/unit/util/setopts_spec.rb
419
+ - spec/unit/util/subprocess_spec.rb
416
420
  - spec/unit/util/subprocess/result_spec.rb
417
421
  - spec/unit/util/subprocess/subprocess_error_spec.rb
418
- - spec/unit/util/subprocess_spec.rb
419
422
  - spec/unit/util/core_ext/hash_ext_spec.rb
420
423
  - spec/unit/errors/formatting_spec.rb
421
- - spec/unit/instance_cache_spec.rb
422
424
  - spec/unit/action/visitor_spec.rb
423
425
  - spec/unit/action/cri_runner_spec.rb
424
- - spec/unit/action/puppetfile/cri_action_spec.rb
425
426
  - spec/unit/action/runner_spec.rb
427
+ - spec/unit/action/puppetfile/cri_action_spec.rb
426
428
  - spec/unit/settings/container_spec.rb
427
429
  - spec/unit/svn/working_dir_spec.rb
428
430
  - spec/unit/svn/remote_spec.rb
429
431
  - spec/unit/source/base_spec.rb
430
432
  - spec/unit/source/svn_spec.rb
431
433
  - spec/unit/source/git_spec.rb
432
- - spec/unit/deployment_spec.rb
433
434
  - spec/unit/module/forge_spec.rb
434
435
  - spec/unit/module/base_spec.rb
435
436
  - spec/unit/module/svn_spec.rb
436
437
  - spec/unit/module/git_spec.rb
437
438
  - spec/unit/module/metadata_spec.rb
438
- has_rdoc:
439
+ has_rdoc: