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

Fix get_host_variables for system tests #4958

Merged
merged 1 commit into from
Feb 14, 2024
Merged

Conversation

Rebits
Copy link
Member

@Rebits Rebits commented Feb 13, 2024

Description

This PR addresses the get_host_variables method to prevent potential system test failures. The resolution of the KeyError issue can be found in the following link: PR #4954.

Testing performed

OneManagerAgent.zip

Note

This fix has only been tested in a one_manager_agent environment for system tests. However, it should address failures across all environments with this improvement.

Furthermore, it has been verified that end-to-end (E2E) tests retain access to the inventory data following this adjustment.

In [8]: hm.get_host_variables('agent1')['os_name']
Out[8]: 'linux'

In [9]: hm.get_host_variables('agent2')['os_name']
Out[9]: 'windows'

In [10]: hm.get_host_variables('agent3')['os_name']
Out[10]: 'linux'

In [11]: hm.get_host_variables('agent4')['os_name']
Out[11]: 'linux'

@Rebits Rebits self-assigned this Feb 13, 2024
@Rebits Rebits linked an issue Feb 13, 2024 that may be closed by this pull request
@Rebits Rebits marked this pull request as ready for review February 13, 2024 12:46
Copy link
Member

@pro-akim pro-akim left a comment

Choose a reason for hiding this comment

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

Review Notes

LGTM

Tested:
agentless.zip

@davidjiglesias davidjiglesias merged commit 7eb080a into 4.8.0 Feb 14, 2024
4 of 5 checks passed
@davidjiglesias davidjiglesias deleted the fix/4941-fix-key-error branch February 14, 2024 06:56
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.

Failed system tests due to KeyError
3 participants