chef-licensing 1.0.0 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e5b5b44e654ed1893f1301c716881eb494bcfe486284269523e45e648f6efd9
4
- data.tar.gz: bce944cdc127668e1b89ab4dde0aa1d11574a37c7958d5b3af6a33101b806ec1
3
+ metadata.gz: 0c948fd9a7a8f207619bd565dd36ac08080d36eba49603c44375c38aa9a07625
4
+ data.tar.gz: c6580bde930ae2e8baa93000cd12b9de11aeff60f5dc53296da96dd8fbefd32d
5
5
  SHA512:
6
- metadata.gz: 777458fc88ca4e0349697ca50c6da364dd966d15e72c1e5122b504ff8446437827665bd7e0390801e39b6b0d0e826a0c385d434597805459caf26df2f833eba2
7
- data.tar.gz: cc705ff5a9d5a8f626e74169bb683fd16db9928782226be465669521d2d0a688d644947625cd6ad931ab1fc53a386799aa4e0033296beefa53832361a2956443
6
+ metadata.gz: 934b42b57560e797c58d0dbafd84306a48e5f6edca46b4c32bf64d066fbfcc380d716765297771baae920f18138a6d183476a37125dbd3f636273fb47a941e60
7
+ data.tar.gz: 36ca4df33d88d079ed8c23b0a91e9f8a78b2d478fc1185f77053c56cd94ab941457b55184839d91df0e3416e0792a19b1f1eff70e183fd6745ced46e0825528c
@@ -138,6 +138,8 @@ module ChefLicensing
138
138
  return license_keys
139
139
  end
140
140
  end
141
+ else
142
+ new_keys = []
141
143
  end
142
144
 
143
145
  # Expired trial licenses and exhausted free licenses will be blocked
@@ -1,3 +1,3 @@
1
1
  module ChefLicensing
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
@@ -35,6 +35,8 @@ module ChefLicensing
35
35
 
36
36
  def check_software_entitlement!
37
37
  # If API call is not breaking that means license is entitled.
38
+ raise ChefLicensing::LicenseKeyFetcher::LicenseKeyNotFetchedError.new("Unable to obtain a License Key.") if license_keys.empty?
39
+
38
40
  client(license_keys: license_keys)
39
41
  true
40
42
  rescue ChefLicensing::ClientError => e
@@ -54,6 +56,13 @@ module ChefLicensing
54
56
  # @note fetch_and_persist is invoked by chef-products to fetch and persist the license keys
55
57
  def fetch_and_persist
56
58
  ChefLicensing::LicenseKeyFetcher.fetch_and_persist
59
+ rescue ChefLicensing::ClientError => e
60
+ # Checking specific text phrase for entitlement error
61
+ if e.message.match?(/not entitled/)
62
+ raise(ChefLicensing::SoftwareNotEntitled, "Software is not entitled.")
63
+ else
64
+ raise
65
+ end
57
66
  end
58
67
 
59
68
  def list_license_keys_info(opts = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-licensing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inspec Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config