-
Notifications
You must be signed in to change notification settings - Fork 80
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
dynamically install rest-client #36
Conversation
def self.get_from_s3(bucket,url,path,aws_access_key_id,aws_secret_access_key,token) | ||
def self.get_from_s3(bucket,url,path,aws_access_key_id,aws_secret_access_key,token) | ||
require 'rest-client' | ||
RestClient.proxy = ENV['http_proxy'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to DRY up these two lines, which are in quite a few places, into a single S3FileLib::connection
method, or some other similarly-named thing. cc @eherot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seconded. The "right" way to do this would be to make the connection an object itself (by defining a new class) and then put the require
in the initialize method for that class. It would also allow you to remove a lot of redundant code from the other methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, good suggestion. Let me put that in.
Yes this is much neater. Do you want me to re-submit the test kitchen work (which was in the previous PR) as a new PR? |
@eherot @jeffbyrnes take a look at the DRY attempt. If it works I think I'm going to merge to allow @salgo to make a kitchen test pr that he worked on. I like the suggestion of making it a whole class but is a bit more refactor than I want to do right now. Ideally I think we replace all the request stuff with Fog as we discussed in #30. |
@salgo yeah, the Test Kitchen bits would be great submitted on their own. |
@joekiller I know @eherot & I would be pleased as peaches to help with a Fog refactor. |
Also, testing out now. Have to stack a bit of our own work on top to deal with buckets w/ dots (because all of ours do), so hang tight. |
@joekiller ok, tests well with Chef 12. |
Handy bit, if you modify the description to say something like “Fixes #34”, when this is merged in, it’ll take care of the other issue. |
Great will merge it soon and publish
|
@@ -122,4 +122,10 @@ def self.verify_md5_checksum(checksum, file) | |||
|
|||
local_md5.hexdigest == s3_md5 | |||
end | |||
|
|||
def self.client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
dynamically install rest-client fix #34
Proposed hacky fix chef 12 removing rest-client. Fixes #34
@evalencia @salgo @jeffbyrnes @edwardvfluke could you try this fix?