chef-licensing 1.0.2 → 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: cf3d6793cef07a261141a45f8c500260a8590a1d60c7fb77076c9c802d42e1e3
4
- data.tar.gz: 482f0db3a900d2ff6871f667331f0b38bd94acde43e6e3fb1fc8de0c450900d1
3
+ metadata.gz: 0c948fd9a7a8f207619bd565dd36ac08080d36eba49603c44375c38aa9a07625
4
+ data.tar.gz: c6580bde930ae2e8baa93000cd12b9de11aeff60f5dc53296da96dd8fbefd32d
5
5
  SHA512:
6
- metadata.gz: da0e21e823c1a3683df7943eb83b0784889de7b8fa2c05d269ca42758c45536bdf3aab9aac88b872baeb13521dab568f1070aefec084fbd20489eb8d37881791
7
- data.tar.gz: d4a1a3b6acd7553186d771238a3930bcc967a7c51a57231afe15820b73ca2788d684fca25c67ae6aaad3dba43247d28a2a463454286d7e4600396067dc8f353c
6
+ metadata.gz: 934b42b57560e797c58d0dbafd84306a48e5f6edca46b4c32bf64d066fbfcc380d716765297771baae920f18138a6d183476a37125dbd3f636273fb47a941e60
7
+ data.tar.gz: 36ca4df33d88d079ed8c23b0a91e9f8a78b2d478fc1185f77053c56cd94ab941457b55184839d91df0e3416e0792a19b1f1eff70e183fd6745ced46e0825528c
@@ -1,3 +1,3 @@
1
1
  module ChefLicensing
2
- VERSION = "1.0.2".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.2
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-23 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