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
Add missing S3 module import #28740
Add missing S3 module import #28740
Conversation
In the get_url method, a salt.utils.s3.query method call is made, but this won't work unless the salt.utils.s3 module is imported. This missing line breaks file.managed resources where source and source_hash attributes use s3:// URLs.
Add missing S3 module import
Thanks, @MasterNayru |
@cachedout Is there anything I should do to get this line added into the 2015.5 and 2015.8 branches as well? As far as I can tell, this is broken in these two versions of Salt as well. |
@MasterNayru I'm sort of surprised this has been broken as far back as 2015.5 without an issue being filed. Do you have an issue that this is linked to? We can definietely backport it. I'm just curious. |
@cachedout I'm pretty surprised as well as I don't see how any use of salt.utils.s3.query would work without importing the salt.utils.s3 module in that file first, and I don't see that import present in fileclient.py in the 2014.7, 2015.5 or 2015.8 branches. As far as existing issues go, I haven't seen any direct reference to this bug from my quick search. |
@MasterNayru K, sounds good. We can just mark this one for backporting, but that's certainly curious. At any rate, thanks for your good detective work here. Much appreciated. |
This is causing a circular import and some serious breakage. I am going to revert this. We need to find a better way to handle this.
|
@cachedout what version of salt were you running for your stacktrace on #28740 (comment)? Curious what version the circular import was on. I'm wondering if it might be caused by the |
@TronPaul I don't remember at all. Probably the HEAD of develop at the time, but I can't say for sure. |
@cachedout I think the weirdness might only exist on branches that have the |
@cachedout I did see the circular import in the I'll open up a PR for |
@TronPaul OK, I'm going to proceed with your PRs on this one to get things back into working order. We'll need to find another fix for the original motivation behind this PR. |
Got any further with this? |
In the get_url method in fileclient.py, a salt.utils.s3.query method call is made, but this won't work unless the salt.utils.s3 module is imported first. This missing line breaks file.managed resources where source and source_hash attributes use s3:// style URLs.