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

tag_server: tag key needs to be cast to string #111

Closed
oliver-byler opened this issue Apr 27, 2015 · 5 comments
Closed

tag_server: tag key needs to be cast to string #111

oliver-byler opened this issue Apr 27, 2015 · 5 comments

Comments

@oliver-byler
Copy link

By default, the type of "k" is a symbol and the SDK requires it to be a string. I may be setting up my config incorrectly but if I cast k to a string, the SDK is happy and accepts it.

Here's my config option for tags:
tags:
"Name": "test-kitchen"

Here's what I did to fix the issue:

def tag_server(server)
  # tag assignation on the instance.
  config[:tags].each do |k, v|
    server.tag(*k.to_s*, :value => v)
  end
  server
end
@litjoco
Copy link

litjoco commented May 5, 2015

Bumped into this problem after updating post the update to TK 1.4 syntax and switching fog dependency.

Thanks for posting, helped me figure out reasons for failures

acm1 pushed a commit to acm1/kitchen-ec2 that referenced this issue May 6, 2015
@jeffbyrnes
Copy link

👍 on this; I ran into the exact same thing today.

@tyler-ball
Copy link
Contributor

Can you try this again with the latest version (0.9.0) of kitchen-ec2? I updated to use the latest AWS SDK gem so this might not be an issue anymore.

@litjoco
Copy link

litjoco commented May 20, 2015

Using release 0.9.0 the tagging was successful

@tyler-ball
Copy link
Contributor

Yay! Closing this - if anyone is using 0.9.0+ and runs into this again, please re-open

Annih added a commit to criteo-forks/kitchen-ec2 that referenced this issue Apr 30, 2019
This commit transform all tags key to Strings, because the ec2 SDK
requires it.
See https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-ec2/lib/aws-sdk-ec2/tag.rb#L260

This is a reproduction of test-kitchen#111 which I think reoccured when we switch
from aws-sdk to aws-sdk-ec2 in 434dc6c97d4a3c4d97ff1f1515a323dc8bc4636.
Annih added a commit to criteo-forks/kitchen-ec2 that referenced this issue Apr 30, 2019
This commit transform all tags key to Strings, because the ec2 SDK
requires it.
See https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-ec2/lib/aws-sdk-ec2/tag.rb#L260

This is a reproduction of test-kitchen#111 which I think reoccured when we switch
from aws-sdk to aws-sdk-ec2 in 434dc6c97d4a3c4d97ff1f1515a323dc8bc4636.

Signed-off-by: Baptiste Courtois <b.courtois@criteo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants