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

[3007.x] Fix #66194: Exchange HTTPClient by AsyncHTTPClient in salt.utils.http #66330

Merged
merged 3 commits into from
Jun 22, 2024

Conversation

krombel
Copy link
Contributor

@krombel krombel commented Apr 9, 2024

What does this PR do?

It replaces HTTPClient by AsyncHTTPClient

What issues does this PR fix or reference?

Fixes #66194

Background

tornadoweb/tornado#2325 (comment)
==> might be caused by #64304

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@krombel krombel requested a review from a team as a code owner April 9, 2024 07:46
@krombel krombel requested review from twangboy and removed request for a team April 9, 2024 07:46
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Fix #66194: Exchange HTTPClient by AsyncHTTPClient in salt.utils.http [master] Fix #66194: Exchange HTTPClient by AsyncHTTPClient in salt.utils.http Apr 9, 2024
@twangboy twangboy requested review from dwoz and removed request for twangboy April 9, 2024 17:21
@twangboy
Copy link
Contributor

Hey @krombel , since this effects 3007, would you mind rebasing this against the 3007.x branch?

@krombel krombel changed the base branch from master to 3007.x April 19, 2024 06:15
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title [master] Fix #66194: Exchange HTTPClient by AsyncHTTPClient in salt.utils.http [3007.x] Fix #66194: Exchange HTTPClient by AsyncHTTPClient in salt.utils.http Apr 19, 2024
@krombel
Copy link
Contributor Author

krombel commented Apr 19, 2024

@twangboy done

@twangboy
Copy link
Contributor

@krombel Would you know how to write a test for this?

@ITJamie
Copy link
Contributor

ITJamie commented Apr 29, 2024

I attempted this patch but got this error:

    Data failed to compile:
----------
    Pillar failed to render with the following messages:
----------
    Failed to load ext_pillar netbox: '_asyncio.Future' object has no attribute 'code'
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/__init__.py", line 1215, in ext_pillar
     ext = self._external_pillar_data(pillar, val, key)
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/__init__.py", line 1135, in _external_pillar_data
     ext = self.ext_pillars[key](self.minion_id, pillar, **val)
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
     ret = self.loader.run(run_func, *args, **kwargs)
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
     return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
     return _func_or_method(*args, **kwargs)
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/netbox.py", line 1118, in ext_pillar
     nodes.extend(_get_devices(api_url, minion_id, headers, api_query_result_limit))
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/netbox.py", line 707, in _get_devices
     device_ret = salt.utils.http.query(
   File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/http.py", line 662, in query
     result_status_code = result.code

@ITJamie
Copy link
Contributor

ITJamie commented Jun 4, 2024

@krombel ive made a pr for your branch to fix the pre-commit issue

@twangboy twangboy added the test:full Run the full test suite label Jun 12, 2024
@dwoz dwoz self-assigned this Jun 22, 2024
@dwoz dwoz merged commit a461c4b into saltstack:3007.x Jun 22, 2024
283 of 368 checks passed
Copy link

welcome bot commented Jun 22, 2024

Congratulations on your first PR being merged! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] ext_pillar netbox not working after upgrade to 3007
4 participants