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 +4 -4
- data/lib/chef-licensing/license_key_fetcher.rb +2 -0
- data/lib/chef-licensing/version.rb +1 -1
- data/lib/chef-licensing.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c948fd9a7a8f207619bd565dd36ac08080d36eba49603c44375c38aa9a07625
|
4
|
+
data.tar.gz: c6580bde930ae2e8baa93000cd12b9de11aeff60f5dc53296da96dd8fbefd32d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934b42b57560e797c58d0dbafd84306a48e5f6edca46b4c32bf64d066fbfcc380d716765297771baae920f18138a6d183476a37125dbd3f636273fb47a941e60
|
7
|
+
data.tar.gz: 36ca4df33d88d079ed8c23b0a91e9f8a78b2d478fc1185f77053c56cd94ab941457b55184839d91df0e3416e0792a19b1f1eff70e183fd6745ced46e0825528c
|
data/lib/chef-licensing.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2024-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|