Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break from loop once a valid policy is found. remove old unused list #1301

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

af7567
Copy link
Contributor

@af7567 af7567 commented Oct 3, 2022

get_patch_policy() was always going through to the end of the agent policies list instead of breaking from the loop once a valid policy is found. Since get_agent_policies() returns the list in order of preference, the least preferred policy was always getting selected.

Also removed the processed_policies list which is not used, seems to be left over from when the policy was selected a different way.

Fixes #1293

@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #1301 (db45400) into develop (ade1a73) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop    #1301      +/-   ##
===========================================
- Coverage    82.42%   82.40%   -0.02%     
===========================================
  Files          114      114              
  Lines         7498     7498              
===========================================
- Hits          6180     6179       -1     
- Misses        1318     1319       +1     
Impacted Files Coverage Δ
api/tacticalrmm/agents/models.py 71.35% <50.00%> (-0.19%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wh1te909
Copy link
Member

wh1te909 commented Oct 6, 2022

thank you!

@wh1te909 wh1te909 merged commit 61807bd into amidaware:develop Oct 6, 2022
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.

Agent assigned Automation Policy - patch policy not used.
2 participants