Skip to content

Conversation

@rane-rajasi
Copy link
Contributor

@rane-rajasi rane-rajasi commented Sep 6, 2023

Issue:

  • ConfigurePatching is marked as failed if '/etc/apt/apt.conf.d/20auto-upgrades' is not found.

'/etc/apt/apt.conf.d/20auto-upgrades' not existing on a VM has been observed to be an indication that default auto updates are not configured. The config file is only created the very first time auto updates are configured on the machine. Hence, non existence of the file can be safely considered as default auto updates are disabled. This also aligns with the implementation patterns used in YUM and Zypper package managers where a config not existing is considered as default updates disabled.

Desired behavior from this PR:
If '/etc/apt/apt.conf.d/20auto-upgrades' is not found:

  • automaticOSPatchState in Configure Patching is marked as Disabled
  • ConfigurePatching status does not fail due to this config not existing

@rane-rajasi rane-rajasi requested review from a team and removed request for a team September 6, 2023 12:32
@rane-rajasi rane-rajasi requested a review from najams September 6, 2023 12:32
@rane-rajasi rane-rajasi requested a review from najams as a code owner September 6, 2023 12:32
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #216 (da5898d) into master (dae984a) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 98.95%.

@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
+ Coverage   90.19%   90.21%   +0.01%     
==========================================
  Files          90       90              
  Lines       14483    14539      +56     
==========================================
+ Hits        13063    13116      +53     
- Misses       1420     1423       +3     
Flag Coverage Δ
python27 90.21% <98.95%> (+0.01%) ⬆️
python39 90.21% <98.95%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/core/src/service_interfaces/StatusHandler.py 94.80% <96.29%> (+0.40%) ⬆️
src/core/src/bootstrap/Constants.py 98.59% <100.00%> (+<0.01%) ⬆️
...ore/src/package_managers/AptitudePackageManager.py 89.62% <100.00%> (+0.02%) ⬆️
src/core/tests/Test_AptitudePackageManager.py 99.49% <100.00%> (+<0.01%) ⬆️
src/core/tests/Test_ConfigurePatchingProcessor.py 99.04% <100.00%> (ø)
src/core/tests/Test_StatusHandler.py 99.77% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@kjohn-msft
Copy link
Collaborator

Please fill in description to describe current behavior and desired behavior.

Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor questions inline

@rane-rajasi
Copy link
Contributor Author

Please fill in description to describe current behavior and desired behavior.

done

@rane-rajasi rane-rajasi merged commit bd81687 into master Sep 14, 2023
@rane-rajasi rane-rajasi deleted the rarane-disabledefaultupdates branch September 14, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants