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

Add support for Linode StackScripts via the stackscript/stackscriptid attributes #60

Merged
merged 1 commit into from Jun 14, 2016

Conversation

tadman
Copy link
Contributor

@tadman tadman commented May 24, 2016

These are shown in the documentation as examples but aren't functional. This patch enables that functionality.

Stackscripts are available in both public and private contexts. Names are done with a direct match to avoid false matches in the order of private and then public.

An additional stackscript_udf_responses argument is added to conform with the Linode API specification for createfromstackscript as this is a required parameter.

@displague
Copy link
Owner

Thanks @tadman, this is great!

We should probably sweep the private stackscripts before/separately from searching through the public list. I realize the time involved is probably minimal to the client but it is an efficiency that jumps out. We already run into rate limiting in multi-machine workloads, anything we can do to lighten the request load will help.

@@ -29,6 +29,23 @@ def call(env)
root_pass = Digest::SHA2.new.update(@machine.provider_config.api_key).to_s
end

if @machine.provider_config.stackscript
stackscripts = @client.stackscript.list + @client.avail.stackscripts
stackscript = stackscripts.find { |s| s.label.downcase == @machine.provider_config.stackscript.to_s.downcase }
Copy link
Owner

@displague displague May 25, 2016

Choose a reason for hiding this comment

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

I'd like to see us find from the private list, then find from the public list if there was no private match.

@displague displague merged commit 7f32a76 into displague:master Jun 14, 2016
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.

None yet

2 participants