r10k 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2NmNmU5ZWE0MDlhNWRlODU2ODc3ZDdkZDRjZmE0ZTc4YWIxOTFhZg==
4
+ YjFlMGI2ZTNiYjgwYmU0YmExOWZiYTUyMDU0ZWY5NzNjOTUxMDgwMg==
5
5
  data.tar.gz: !binary |-
6
- NTY0YTE3NWM5NTBjMmQ1YzQ4Njg4NzQ3YTVkOGYxZDFjYzFjYzcxYw==
6
+ OTc1ZTk4Y2Y2NWY5NDg5NmY2NDEyZTUyMDBhZWRmNGZjZjk0MjgwYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTU5YTUwNGYwZmZlOTFmOGMzNjg1NzFmM2MwYTc5NWQzYTQ5Njg4ODlhZWRj
10
- ZTMxYWViNjE4ZmI3MjA2MjEyZmJmZmE5ZGU4ZWQyNTgwNTEyYmI4M2JlMmMz
11
- NzRhNzlkZThhNThjOWQ4YzQyZGMzNjdhMTcyMTY5NmQ5MzcxYjQ=
9
+ NGRkZGIyNGI2ZWIzODk5NjBkN2Q2N2RhMWFmODk1N2NjYTNlYzFjMGM4NDJk
10
+ NzQ3MzkzMTEzNjY5MmMyZjdlZjFiMjIwZTY1MzQ1ZjRhZTg4MTQyN2EwYzlh
11
+ YzYyMTU3ZWY3ODZkOTBlMjJmOGU4OWNkZTY4ZDgzMDgzOTc4MzY=
12
12
  data.tar.gz: !binary |-
13
- NmQxMzE5ZDZhYzgxYTQzNzQzNTRlYWUyODQ3ZGE5MTNiMDU4MzFjMjQ1YTQ1
14
- MDcwMmJlODRhZmEzZDNkODIxOTc0NmZiNzgwMmRjNDVlNzRjY2VjMmNhYjAw
15
- ZDcwYjZlNzBiNjVjNjFmZWMyYWIwNjkzNDMwMGNlMWMwMjdhMjU=
13
+ NmYzODIzY2YzM2QxNzllNWUzNTIyYTVhODgyZGQ2ODIzNjBkZDZkN2JkYmNk
14
+ YzliY2Q2OGRiM2U5MWRlNzFlM2Q1Y2VkYjk3NGI1ODRhOTQ4NjQxYTk0YWMx
15
+ ZjdjZmVhYTBhOTIwNGY5OTlmYmQzZjFjNWRhOTJlZmIwOWU3Njk=
data/CHANGELOG.mkd CHANGED
@@ -1,6 +1,31 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 1.3.3
5
+ -----
6
+
7
+ 2014/09/11
8
+
9
+ ### User notes
10
+
11
+ (GH-178) Failing to fetch a source git repo can wipe out environments
12
+
13
+ When updating Git sources at the beginning of a deployment, if the fetch was
14
+ interrupted r10k could cache an empty list of environments. This could cause
15
+ r10k to remove all environments for that source. This was due to a method
16
+ directly using a value that was supposed to be lazily evaluated and memoized. It
17
+ has been fixed so that even if r10k cannot fetch a source it will still be able
18
+ to deploy modules for environments, clean up removed environments, and correctly
19
+ remove unmanaged environments.
20
+
21
+ (GH-186) Rescue SyntaxError when checking Puppetfile syntax
22
+
23
+ When a Puppetfile with invalid syntax is parsed it raises a SyntaxError,
24
+ and the `r10k puppetfile check` code was not specifically handling that.
25
+ Thus when checking an invalid file r10k was actually crashing and not
26
+ gracefully handling the error. This was fixed to cleanly rescue the SyntaxError,
27
+ optionally print stacktraces, and print an all ok message on success.
28
+
4
29
  1.3.2
5
30
  -----
6
31
 
@@ -63,13 +63,15 @@ Puppetfile (http://bombasticmonkey.com/librarian-puppet/).
63
63
  puppetfile = R10K::Puppetfile.new(puppetfile_root, puppetfile_path, puppetfile)
64
64
  begin
65
65
  puppetfile.load
66
- rescue LoadError => ex
67
- $stderr.puts "ERROR: Puppetfile bad syntax"
68
- ex.backtrace.each do |line|
69
- puts line
66
+ rescue SyntaxError, LoadError => e
67
+ $stderr.puts "ERROR: Could not parse Puppetfile"
68
+ $stderr.puts e.message
69
+ if opts[:trace]
70
+ $stderr.puts e.backtrace.join("\n")
70
71
  end
71
72
  exit 1
72
73
  end
74
+ puts "Syntax OK"
73
75
  exit 0
74
76
  end
75
77
  end
@@ -3,36 +3,37 @@ require 'r10k/deployment/environment'
3
3
  require 'r10k/util/purgeable'
4
4
 
5
5
  module R10K
6
- class Deployment
7
- class Basedir
8
- # Represents a directory containing environments
6
+ class Deployment
9
7
 
10
- def initialize(path,deployment)
11
- @path = path
12
- @deployment = deployment
13
- end
8
+ # Represents a directory containing environments
9
+ # @api private
10
+ class Basedir
14
11
 
15
- include R10K::Util::Purgeable
12
+ def initialize(path,deployment)
13
+ @path = path
14
+ @deployment = deployment
15
+ end
16
16
 
17
- # Return the path of the basedir
18
- # @note This implements a required method for the Purgeable mixin
19
- # @return [String]
20
- def managed_directory
21
- @path
22
- end
17
+ include R10K::Util::Purgeable
18
+
19
+ # Return the path of the basedir
20
+ # @note This implements a required method for the Purgeable mixin
21
+ # @return [String]
22
+ def managed_directory
23
+ @path
24
+ end
23
25
 
24
- # List all environments that should exist in this basedir
25
- # @note This implements a required method for the Purgeable mixin
26
- # @return [Array<String>]
27
- def desired_contents
28
- @keepers = []
29
- @deployment.sources.each do |source|
30
- next unless source.managed_directory == @path
31
- @keepers += source.desired_contents
26
+ # List all environments that should exist in this basedir
27
+ # @note This implements a required method for the Purgeable mixin
28
+ # @return [Array<String>]
29
+ def desired_contents
30
+ @deployment.sources.inject([])do |list, source|
31
+ if source.managed_directory == @path
32
+ list += source.desired_contents
33
+ end
34
+ list
35
+ end
36
+ end
32
37
  end
33
- @keepers
34
38
  end
35
-
36
- end
37
- end
38
39
  end
@@ -75,10 +75,10 @@ class R10K::Source::Git < R10K::Source::Base
75
75
  def environments
76
76
  if not @cache.cached?
77
77
  []
78
- elsif not @environments.empty?
79
- @environments
80
- else
78
+ elsif @environments.empty?
81
79
  @environments = generate_environments()
80
+ else
81
+ @environments
82
82
  end
83
83
  end
84
84
 
@@ -120,7 +120,7 @@ class R10K::Source::Git < R10K::Source::Base
120
120
  # @note This implements a required method for the Purgeable mixin
121
121
  # @return [Array<String>]
122
122
  def desired_contents
123
- @environments.map {|env| env.dirname }
123
+ environments.map {|env| env.dirname }
124
124
  end
125
125
 
126
126
  private
data/lib/r10k/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '1.3.2'
2
+ VERSION = '1.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-27 00:00:00.000000000 Z
11
+ date: 2014-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored