diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 38f4af6d2a..4b6bc48d75 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/chef/omnibus-software.git - revision: f9e2df62cdc17bf2efd58492a547437866f3bc77 + revision: bfa5386338ed36e1f69c6176065ef30e2aff3988 branch: main specs: omnibus-software (24.6.323) - ffi (>= 1.17.0) + ffi (< 1.17.0) omnibus (>= 9.0.0) GIT @@ -17,6 +17,7 @@ GIT chef-cleanroom (~> 1.0) chef-utils (>= 15.4) contracts (>= 0.16.0, < 0.17.0) + ffi (< 1.17.0) ffi-yajl (~> 2.2) license_scout (~> 1.0) mixlib-shellout (>= 2.0, < 4.0) @@ -32,29 +33,31 @@ GEM specs: addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - artifactory (3.0.15) + artifactory (3.0.17) + ast (2.4.2) awesome_print (1.9.2) aws-eventstream (1.3.0) - aws-partitions (1.968.0) - aws-sdk-core (3.201.5) + aws-partitions (1.997.0) + aws-sdk-core (3.211.0) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) + aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.88.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-kms (1.95.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) aws-sdk-s3 (1.116.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sdk-secretsmanager (1.72.0) - aws-sdk-core (~> 3, >= 3.165.0) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.9.1) + aws-sdk-secretsmanager (1.109.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) - bcrypt_pbkdf (1.1.0) - berkshelf (8.0.5) + base64 (0.2.0) + bcrypt_pbkdf (1.1.1) + berkshelf (8.0.9) chef (>= 15.7.32) chef-config cleanroom (~> 1.0) @@ -67,42 +70,43 @@ GEM retryable (>= 2.0, < 4.0) solve (~> 4.0) thor (>= 0.20) - builder (3.2.4) - chef (17.10.0) + bigdecimal (3.1.8) + builder (3.3.0) + chef (17.10.163) addressable aws-sdk-s3 (~> 1.91) aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.10.0) - chef-utils (= 17.10.0) + chef-config (= 17.10.163) + chef-utils (= 17.10.163) chef-vault chef-zero (>= 14.0.11) corefoundation (~> 0.3.4) diff-lcs (>= 1.2.4, < 1.6.0, != 1.4.0) erubis (~> 2.7) - ffi (>= 1.5.0) + ffi (~> 1.15.5) ffi-libarchive (~> 1.0, >= 1.0.3) - ffi-yajl (~> 2.2) + ffi-yajl (>= 2.2, < 4.0) iniparse (~> 1.4) - inspec-core (~> 4.23) + inspec-core (~> 5.22.40) license-acceptance (>= 1.0.5, < 3) mixlib-archive (>= 0.4, < 2.0) mixlib-authentication (>= 2.1, < 4) mixlib-cli (>= 2.1.1, < 3.0) mixlib-log (>= 2.0.3, < 4.0) mixlib-shellout (>= 3.1.1, < 4.0) - net-sftp (>= 2.1.2, < 4.0) - ohai (~> 17.0) + net-sftp (>= 2.1.2, < 5.0) + ohai (~> 17.9) plist (~> 3.2) - proxifier (~> 1.0) + proxifier2 (~> 1.1) syslog-logger (~> 1.6) - train-core (~> 3.2, >= 3.2.28) + train-core (~> 3.10, < 3.12.5) train-winrm (>= 0.2.5) uuidtools (>= 2.1.5, < 3.0) - vault (~> 0.16) + vault (~> 0.18.2) chef-cleanroom (1.0.5) - chef-config (17.10.0) + chef-config (17.10.163) addressable - chef-utils (= 17.10.0) + chef-utils (= 17.10.163) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) @@ -110,9 +114,9 @@ GEM chef-telemetry (1.1.1) chef-config concurrent-ruby (~> 1.0) - chef-utils (17.10.0) + chef-utils (17.10.163) concurrent-ruby - chef-vault (4.1.10) + chef-vault (4.1.11) chef-zero (15.0.11) ffi-yajl (~> 2.2) hashie (>= 2.0, < 5.0) @@ -125,29 +129,24 @@ GEM coderay (1.1.3) concurrent-ruby (1.3.4) contracts (0.16.1) + cookstyle (7.32.8) + rubocop (= 1.25.1) corefoundation (0.3.13) ffi (>= 1.15.0) - diff-lcs (1.5.0) + diff-lcs (1.5.1) ed25519 (1.3.0) - erubi (1.12.0) + erubi (1.13.0) erubis (2.7.0) - faraday (1.4.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - multipart-post (>= 1.2, < 3) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday_middleware (1.2.0) - faraday (~> 1.0) - ffi (1.17.0) - ffi-libarchive (1.1.3) + faraday (2.12.0) + faraday-net_http (>= 2.0, < 3.4) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.3.0) + net-http + ffi (1.15.5) + ffi-libarchive (1.1.14) ffi (~> 1.0) ffi-yajl (2.6.0) libyajl2 (>= 1.2) @@ -160,74 +159,80 @@ GEM hashie (4.1.0) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.56.20) + inspec-core (5.22.55) addressable (~> 2.4) chef-telemetry (~> 1.0, >= 1.0.8) - faraday (>= 0.9.0, < 1.5) - faraday_middleware (~> 1.0) - hashie (>= 3.4, < 5.0) + cookstyle + faraday (>= 1, < 3) + faraday-follow_redirects (~> 0.3) + hashie (>= 3.4, < 6.0) license-acceptance (>= 0.2.13, < 3.0) method_source (>= 0.8, < 2.0) mixlib-log (~> 3.0) multipart-post (~> 2.0) parallel (~> 1.9) - parslet (>= 1.5, < 2.0) + parslet (>= 1.5, < 3.0) pry (~> 0.13) - rspec (>= 3.9, <= 3.11) + rspec (>= 3.9, <= 3.12) rspec-its (~> 1.2) rubyzip (>= 1.2.2, < 3.0) semverse (~> 3.0) sslshake (~> 1.2) - thor (>= 0.20, < 2.0) + thor (>= 0.20, < 1.3.0) tomlrb (>= 1.2, < 2.1) - train-core (~> 3.0) + train-core (~> 3.10) tty-prompt (~> 0.17) tty-table (~> 0.10) - iostruct (0.1.3) + iostruct (0.2.0) ipaddress (0.8.3) jmespath (1.6.2) - json (2.7.2) + json (2.7.4) libyajl2 (2.1.0) license-acceptance (2.1.13) pastel (~> 0.7) tomlrb (>= 1.2, < 3.0) tty-box (~> 0.6) tty-prompt (~> 0.20) - license_scout (1.3.10) + license_scout (1.3.15) ffi-yajl (~> 2.2) mixlib-shellout (>= 2.2, < 4.0) toml-rb (>= 1, < 3) little-plugger (1.1.4) - logging (2.3.1) + logger (1.6.1) + logging (2.4.0) little-plugger (~> 1.1) multi_json (~> 1.14) - method_source (1.0.0) - minitar (0.9) + method_source (1.1.0) + minitar (0.12.1) mixlib-archive (1.1.7) mixlib-log mixlib-authentication (3.0.10) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb - mixlib-install (3.12.27) + mixlib-install (3.12.30) mixlib-shellout mixlib-versioning thor - mixlib-log (3.0.9) - mixlib-shellout (3.2.8) + mixlib-log (3.1.1) + ffi (< 1.17.0) + mixlib-shellout (3.3.3) chef-utils mixlib-versioning (1.2.12) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.4.1) + net-http (0.4.1) + uri net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (7.2.3) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) + net-ssh (7.3.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) - nori (2.6.0) + nori (2.7.1) + bigdecimal octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) @@ -244,8 +249,11 @@ GEM plist (~> 3.1) train-core wmi-lite (~> 1.0) - parallel (1.22.1) - parslet (1.8.2) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc + parslet (2.0.0) pastel (0.8.0) tty-color (~> 0.5) pedump (0.6.10) @@ -255,36 +263,48 @@ GEM rainbow zhexdump (>= 0.0.2) plist (3.7.1) - proxifier (1.0.3) + proxifier2 (1.1.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) public_suffix (6.0.1) - rack (2.2.6.4) + racc (1.8.1) + rack (2.2.10) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) + regexp_parser (2.9.2) retryable (3.0.5) - rexml (3.3.6) - strscan - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) + rexml (3.3.9) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.3) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.4) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-its (1.3.0) + rspec-support (~> 3.12.0) + rspec-its (1.3.1) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.11.2) + rspec-mocks (3.12.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.2) + rubocop (1.25.1) + parallel (~> 1.10) + parser (>= 3.1.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.15.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - rubyntlm (0.6.3) + rubyntlm (0.6.5) + base64 rubyzip (2.3.2) sawyer (0.9.2) addressable (>= 2.3.5) @@ -299,9 +319,8 @@ GEM unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) - strscan (3.1.0) syslog-logger (1.6.8) - test-kitchen (3.5.0) + test-kitchen (3.5.1) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -315,11 +334,11 @@ GEM winrm (~> 2.0) winrm-elevated (~> 1.0) winrm-fs (~> 1.1) - thor (1.3.1) + thor (1.2.2) toml-rb (2.2.0) citrus (~> 3.0, > 3.0) tomlrb (1.3.0) - train-core (3.12.7) + train-core (3.12.3) addressable (~> 2.5) ffi (!= 1.13.0) json (>= 1.8, < 3.0) @@ -343,25 +362,27 @@ GEM tty-cursor (~> 0.7) tty-screen (~> 0.8) wisper (~> 2.0) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-table (0.12.0) pastel (~> 0.8) strings (~> 0.2.0) tty-screen (~> 0.8) - unicode-display_width (2.4.2) + unicode-display_width (2.6.0) unicode_utils (1.4.0) + uri (0.13.1) uuidtools (2.2.0) - vault (0.17.0) + vault (0.18.2) aws-sigv4 - webrick (1.8.1) - winrm (2.3.6) + webrick (1.8.2) + winrm (2.3.9) builder (>= 2.1.2) erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) - nori (~> 2.0) + nori (~> 2.0, >= 2.7.1) + rexml (~> 3.0) rubyntlm (~> 0.6.0, >= 0.6.3) winrm-elevated (1.2.3) erubi (~> 1.8) @@ -377,7 +398,7 @@ GEM zhexdump (0.2.0) PLATFORMS - ruby + x86_64-linux DEPENDENCIES artifactory @@ -389,4 +410,4 @@ DEPENDENCIES test-kitchen BUNDLED WITH - 2.2.22 + 2.3.5 diff --git a/src/chef-server-ctl/plugins/key_control.rb b/src/chef-server-ctl/plugins/key_control.rb index b1edf0a374..59a34b3564 100644 --- a/src/chef-server-ctl/plugins/key_control.rb +++ b/src/chef-server-ctl/plugins/key_control.rb @@ -89,6 +89,14 @@ @helper.exit_failure("Error: A key named #{@options.key_name} already exists for #{@options.clientname} in org #{@options.orgname}.") elsif e.response.code == "404" @helper.exit_failure("Error: Could not find client #{@options.clientname} in org #{@options.orgname}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end @@ -155,6 +163,14 @@ @helper.exit_failure("Error: A key named #{@options.key_name} already exists for user #{@options.username}.") elsif e.response.code == "404" @helper.exit_failure("Error: Could not find user #{@options.username}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end @@ -196,6 +212,14 @@ rescue Net::HTTPServerException => e if e.response.code == "404" @helper.exit_failure("Error: Could not find client #{@options.clientname} in org #{@options.orgname}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end @@ -236,6 +260,14 @@ rescue Net::HTTPServerException => e if e.response.code == "404" @helper.exit_failure("Error: Could not find user #{@options.username}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end @@ -258,6 +290,14 @@ rescue Net::HTTPServerException => e if e.response.code == "404" @helper.exit_failure("Error: Could not find key #{@options.key_name} for user #{@options.username}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end @@ -282,6 +322,14 @@ rescue Net::HTTPServerException => e if e.response.code == "404" @helper.exit_failure("Error: Could not find key #{@options.key_name} for user #{@options.username}.") + elsif e.response.code == "403" + resp_message = JSON.parse(e.response.body) + if resp_message['message'] == 'invalid-license' + puts resp_message['error'] + puts resp_message['message'] + else + @helper.exit_http_fail(e) + end else @helper.exit_http_fail(e) end diff --git a/src/oc_erchef/apps/chef_license/src/chef_license_worker.erl b/src/oc_erchef/apps/chef_license/src/chef_license_worker.erl index 488b9d3b9c..4cf7b5b68c 100644 --- a/src/oc_erchef/apps/chef_license/src/chef_license_worker.erl +++ b/src/oc_erchef/apps/chef_license/src/chef_license_worker.erl @@ -25,7 +25,8 @@ license_cache, grace_period, expiration_date, - message + message, + customer_name }). -define(DEFAULT_LICENSE_SCAN_INTERVAL, 30000). %milli seconds @@ -53,10 +54,10 @@ init(_Config) -> erlang:send_after(?DEFAULT_LICENSE_SCAN_INTERVAL, self(), check_license), {ok, State}. -handle_call(get_license, _From, #state{license_cache = undefined, license_type=Type, expiration_date=ExpDate, grace_period = GracePeriod, message = Msg}=State) -> - {reply, {valid_license, Type, GracePeriod, ExpDate, Msg}, State}; -handle_call(get_license, _From, #state{license_cache = Lic, license_type=Type, expiration_date=ExpDate, grace_period = GracePeriod, message = Msg} = State) -> - {reply,{Lic, Type, GracePeriod, ExpDate, Msg}, State}; +handle_call(get_license, _From, #state{license_cache = undefined, license_type=Type, expiration_date=ExpDate, grace_period = GracePeriod, message = Msg, customer_name=CN}=State) -> + {reply, {valid_license, Type, GracePeriod, ExpDate, Msg, CN}, State}; +handle_call(get_license, _From, #state{license_cache = Lic, license_type=Type, expiration_date=ExpDate, grace_period = GracePeriod, message = Msg, customer_name=CN} = State) -> + {reply,{Lic, Type, GracePeriod, ExpDate, Msg, CN}, State}; handle_call(_Message, _From, State) -> {noreply, State}. @@ -87,14 +88,14 @@ check_license(State) -> {'EXIT', _} -> <<"">> end, case process_license(JsonStr) of - {ok, valid_license, ExpDate} -> - State#state{license_cache=valid_license, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate}; - {ok, commercial_expired, ExpDate, Msg} -> - State#state{license_cache=commercial_expired, license_type = <<"commercial">>, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg}; - {ok, commercial_grace_period, ExpDate, Msg} -> - State#state{license_cache=commercial_grace_period, grace_period=true, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg}; - {ok, trial_expired, ExpDate, Msg} -> - State#state{license_cache=trial_expired_expired, license_type = <<"trial">>, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg}; + {ok, valid_license, ExpDate, CustomerName} -> + State#state{license_cache=valid_license, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate, customer_name=CustomerName}; + {ok, commercial_expired, ExpDate, Msg, CustomerName} -> + State#state{license_cache=commercial_expired, license_type = <<"commercial">>, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg, customer_name=CustomerName}; + {ok, commercial_grace_period, ExpDate, Msg, CustomerName} -> + State#state{license_cache=commercial_grace_period, grace_period=true, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg, customer_name=CustomerName}; + {ok, trial_expired, ExpDate, Msg, CustomerName} -> + State#state{license_cache=trial_expired_expired, license_type = <<"trial">>, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date=ExpDate, message=Msg, customer_name=CustomerName}; {error, no_license} -> State#state{license_cache=trial_expired_expired, license_type = <<"trial">>, grace_period=undefined, scanned_time = erlang:timestamp(), expiration_date="", message=get_alert_message(trial_expired, "")}; {error, _} -> State @@ -111,25 +112,24 @@ process_license(<<"">>)-> process_license(LicJson) -> case ej:get({<<"result">>}, LicJson) of {LicDetails} -> + CustomerName = ej:get({<<"customer_name">>}, LicDetails), case ej:get({<<"expiration_date">>}, LicDetails) of {[{<<"seconds">>,ExpireInSeconds}]} -> ExpDate = sec_to_date(ExpireInSeconds), case os:system_time(second) < ExpireInSeconds of - true -> {ok, valid_license, ExpDate}; + true -> {ok, valid_license, ExpDate, CustomerName}; _ -> case ej:get({<<"license_type">>}, LicDetails) of <<"commercial">> -> case ej:get({<<"grace_period">>}, LicDetails) of true -> - %% WARNING {ok, commercial_grace_period, ExpDate, - get_alert_message(commercial_grace_period, ExpDate)}; + get_alert_message(commercial_grace_period, ExpDate), CustomerName}; _ -> - %% MSG - { ok, commercial_expired, ExpDate, get_alert_message(commercial_expired, ExpDate)} + { ok, commercial_expired, ExpDate, get_alert_message(commercial_expired, ExpDate), CustomerName} end; _ -> - {ok, trial_expired, ExpDate, get_alert_message(trial_expired, ExpDate)} + {ok, trial_expired, ExpDate, get_alert_message(trial_expired, ExpDate), CustomerName} end end; _ -> diff --git a/src/oc_erchef/apps/oc_chef_wm/src/oc_chef_wm_base.erl b/src/oc_erchef/apps/oc_chef_wm/src/oc_chef_wm_base.erl index fa91de4ee4..52e0ba2cb0 100644 --- a/src/oc_erchef/apps/oc_chef_wm/src/oc_chef_wm_base.erl +++ b/src/oc_erchef/apps/oc_chef_wm/src/oc_chef_wm_base.erl @@ -89,16 +89,16 @@ service_available(Req, #base_state{reqid_header_name = HeaderName} = State) -> {true, Req, State3}; _ -> case chef_license_worker:get_license() of - {valid_license, _, _, _, _} -> + {valid_license, _, _, _, _, _} -> {true, Req, State3}; - {commercial_grace_period, _, _, ExpDate, LicWarnMsg} -> + {commercial_grace_period, _, _, ExpDate, LicWarnMsg, _} -> XOps = binary_to_list(chef_json:encode({[{<<"licenseType">>, <<"commercial">>},{<<"expirationDateTime">>, list_to_binary(ExpDate)}, - {<<"warningMessage">>, list_to_binary(LicWarnMsg)}]})), + {<<"warningMessage">>, list_to_binary(LicWarnMsg)}, {<<"gracePeriod">>, true}]})), Req1 = wrq:set_resp_header("X-Ops-License", XOps, Req), {true, Req1, State3}; - {_, Type, _, ExpDate, LicWarnMsg} -> + {_, Type, _, ExpDate, LicWarnMsg, _} -> XOps = binary_to_list(chef_json:encode({[{<<"licenseType">>, Type},{<<"expirationDateTime">>, list_to_binary(ExpDate)}, - {<<"warningMessage">>, list_to_binary(LicWarnMsg)}]})), + {<<"warningMessage">>, list_to_binary(LicWarnMsg)}, {<<"gracePeriod">>, false}]})), Req1 = wrq:set_resp_header("X-Ops-License", XOps, Req), Req2 = chef_wm_util:set_json_body(Req1, {[{<<"error">>, list_to_binary(LicWarnMsg)}, {<<"message">>, <<"invalid-license">>}]}),