Update variable names and call different function to get package manager name #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were some comments left on the pull request #161 which were not addressed in that pull request as the comments were non-blocking for that pull request. We have merged that pull request and addressed the comments in this new pull request.
Changes done:
(a) Use package_manager.get_package_manager_setting(Constants.PKG_MGR_SETTING_IDENTITY) to get the package manager name which will return values like "apt", "yum" or "zypper" instead of using package_manager.class.name which returns class name like AptitudePackageManager, etc.
(b) Update number_of_tries to retry_count
(c) Update number_of_rounds to retry_count
Manual testing completed:
Tested that one-time assessment and one-time install patches are working fine.
Tested that the log generated has expected package manager name and now retry_count is there in log instead of number_of_tries
Example of perf log for assessment:
Stopwatch details: {'start_time': '2023-02-24 07:27:47.045594', 'end_time': '2023-02-24 07:27:49.749904', 'time_taken': '0.04507183333333333', 'machine_info': {'platform_name': 'Ubuntu', 'platform_version': '18.04', 'machine_cpu': 'Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz', 'machine_arch': 'x86_64', 'disk_type': 'Hard drive'}, 'message': "{'task': 'Assessment', 'task_status': 'succeeded', 'error_msg': '', 'package_manager': 'apt', 'retry_count': '1'}"}
Example of perf log for installation:
Stopwatch details: {'start_time': '2023-02-24 07:30:20.425733', 'end_time': '2023-02-24 07:34:18.866651', 'time_taken': '3.9740153', 'machine_info': {'platform_name': 'Ubuntu', 'platform_version': '18.04', 'machine_cpu': 'Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz', 'machine_arch': 'x86_64', 'disk_type': 'Hard drive'}, 'message': "{'task': 'Installation', 'task_status': 'succeeded', 'error_msg': '', 'package_manager': 'apt', 'patch_operation_successful': 'True', 'installed_patch_count': '2', 'retry_count': '1', 'maintenance_window': '3:55:00', 'perc_maintenance_window_used': '2.147989744680851', 'maintenance_window_exceeded': 'False'}"}