-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified error message for license expiry case (#3926)
Signed-off-by: jan shahid shaik <[email protected]>
- Loading branch information
Showing
3 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,8 @@ check_license(State) -> | |
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}; | ||
{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 | ||
end. | ||
|
||
|
@@ -133,16 +135,23 @@ process_license(LicJson) -> | |
_ -> | ||
{error, invalid_response} | ||
end; | ||
undefined -> | ||
case ej:get({<<"status">>}, LicJson) of | ||
<<"OK">> -> | ||
{error, no_license}; | ||
_ -> | ||
{error, invalid_response} | ||
end; | ||
_ -> | ||
{error, invalid_response} | ||
end. | ||
|
||
get_alert_message(Type, ExpDate)-> | ||
case Type of | ||
trial_expired -> | ||
"Your Progress Chef InfraServer license has expired or does not exist! You no longer have access to Chef Automate. Please contact the Account Team to upgrade to an Enterprise License."; | ||
"Your Progress Chef InfraServer license has expired or does not exist! You no longer have access to Chef InfraServer. Please contact the Account Team to upgrade to an Enterprise License."; | ||
commercial_expired -> | ||
"Your Progress Chef InfraServer license expired on " ++ ExpDate ++ " and you no longer have access to Chef Automate! To get a new license, please contact the Account Team or email us at [email protected]"; | ||
"Your Progress Chef InfraServer license expired on " ++ ExpDate ++ " and you no longer have access to Chef InfraServer! To get a new license, please contact the Account Team or email us at [email protected]"; | ||
commercial_grace_period -> | ||
"Your Progress Chef InfraServer license expired on " ++ ExpDate ++ " and you are currently on a limited extension period! To get a new license, please contact the Account Team or email us at [email protected]" | ||
end. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters