r10k 2.0.2 → 2.0.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
- MjNhZTM2NGM2Y2I5ZWVjMmM3NjZjMTkzZTY4ZjhkNWRmZjNiODA2Nw==
4
+ ZGIwYzM5NTYxYjdiMGU3ZjgwNzgxYjYyODIwMDVlMWU2MmQ1ZDYyYw==
5
5
  data.tar.gz: !binary |-
6
- MzY0NGYyYTM3YzdlMDhjZWU2MDkyM2NiMmZlNmYyNzU1ZWZiMDc3ZQ==
6
+ ZmQ2NjM2NTFhNzM0NzM5ZjllNDY3MjFiNWFhM2FjYmFiZGM2YzZlZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjUyYjMwOWJhOGY2MWI0OWFmYjUyYmY3OGE5NjI4MTE1YjMzMjUzZjgyOTY5
10
- OGY3NTIxYWNhMWUyMWY5ZDEwZmM5MGI1NjFkZDJjZjRmYzU3NmZhZmVlNzM0
11
- NTgzMjM0ZTM5NGY0OTJjNWJmOWQ1YjJhMTlkOWZiZjNhYThhM2M=
9
+ ZjU1Mzc1ODgyMTlmNWRlNzYwMTU1ZGNkM2Y3NjM1ZDgzMTMwODgzNmVmYTc0
10
+ NTBjMzAwYTg3MzUyYzczNTdkNjJlNDAxZjk2NzFkYzMzMzRlYWQ0N2ZhODFl
11
+ Mjg3ZWExNTBlMTJlMWQxODJiODQ5ZWQyMDY3MGQ2YmQ5NDA4NTE=
12
12
  data.tar.gz: !binary |-
13
- ZGE4NmFlMTU3YTE2NDY5NTMyYzNmOWNhMjhlNGYzYmQzNjU5MWQwYzNjMDNi
14
- NzhmOGQ2YTMyYWM0ZWM3MTk4ZWJhZWQ5OTJjZDYyZDcxMmJiZTA1NjA0NzY0
15
- NjMyMTk4Njk0YzBlM2Q3ODI5YWEyZDMxYzU0NTBkZDgxYjU4Mzk=
13
+ NjhlNzAxZWJiYzcxMzYwNzIwNDFkODI2MGVkNTg4ZWI1MDAyYjkyMWEzYzJj
14
+ ZmI1NjJkMjQ2OTdlYjQ2YTIwNTZlMzJmM2ZhMDc0OTlhMDM2MjdmOWZkNmZk
15
+ ZjcyOTNlN2JhZDYwMjkyNzkyZTE0MzY1MDliNDZmY2NkNDJhYjY=
@@ -1,6 +1,23 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.0.3
5
+ -----
6
+
7
+ 2015/8/13
8
+
9
+ This is a bugfix release that resolves a critical issue issue in installing PE
10
+ only modules.
11
+
12
+ ### Notes
13
+
14
+ (RK-156) PE-only modules cannot be installed
15
+
16
+ The mechanism used to load PE license information in r10k was preventing r10k
17
+ from not being able to locate the pe-license Ruby library in PE 2015.2.0; this
18
+ has been resolved by actually trying to load the relevant files instead of
19
+ probing for a gem and then conditionally loading it.
20
+
4
21
  2.0.2
5
22
  -----
6
23
 
@@ -16,3 +16,5 @@ end
16
16
  R10K::Features.add(:shellgit) { R10K::Util::Commands.which('git') }
17
17
 
18
18
  R10K::Features.add(:rugged, :libraries => 'rugged')
19
+
20
+ R10K::Features.add(:pe_license, :libraries => 'pe_license')
@@ -1,19 +1,23 @@
1
1
  require 'r10k/errors'
2
- require 'rubygems'
2
+ require 'r10k/features'
3
3
 
4
4
  module R10K
5
5
  module Util
6
6
  module License
7
+ extend R10K::Logging
8
+
7
9
  def self.load
8
- if Gem::Specification::find_all_by_name('pe-license').any?
10
+ if R10K::Features.available?(:pe_license)
11
+ logger.debug2 "pe_license feature is available, loading PE license key"
9
12
  begin
10
13
  return PELicense.load_license_key
11
14
  rescue PELicense::InvalidLicenseError => e
12
15
  raise R10K::Error.wrap(e, "Invalid PE license detected: #{e.message}")
13
16
  end
17
+ else
18
+ logger.debug2 "pe_license feature is not available, PE only Puppet modules will not be downloadable."
19
+ nil
14
20
  end
15
-
16
- nil
17
21
  end
18
22
  end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '2.0.2'
2
+ VERSION = '2.0.3'
3
3
  end
@@ -31,4 +31,11 @@ Could not install package
31
31
 
32
32
  class ModuleReleaseNotFound < PuppetForge::Error
33
33
  end
34
+
35
+ class ModuleReleaseForbidden < PuppetForge::Error
36
+ def self.from_response(response)
37
+ body = JSON.parse(response[:body])
38
+ new(body["message"])
39
+ end
40
+ end
34
41
  end
@@ -1,6 +1,7 @@
1
1
  require 'shared/puppet_forge/v3'
2
2
  require 'shared/puppet_forge/connection'
3
3
  require 'shared/puppet_forge/error'
4
+ require 'json'
4
5
 
5
6
  module PuppetForge
6
7
  module V3
@@ -46,6 +47,12 @@ module PuppetForge
46
47
  path.open('wb') { |fh| fh.write(resp.body) }
47
48
  rescue Faraday::ResourceNotFound => e
48
49
  raise PuppetForge::ModuleReleaseNotFound, "The module release #{slug} does not exist on #{conn.url_prefix}.", e.backtrace
50
+ rescue Faraday::ClientError => e
51
+ if e.response[:status] == 403
52
+ raise PuppetForge::ModuleReleaseForbidden.from_response(e.response)
53
+ else
54
+ raise e
55
+ end
49
56
  end
50
57
 
51
58
  # Verify that a downloaded module matches the checksum in the metadata for this release.
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: 2.0.2
4
+ version: 2.0.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: 2015-06-18 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored