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

Aws autoscaling/fix tag assignment #2208

Merged
merged 4 commits into from Oct 2, 2013
Merged

Aws autoscaling/fix tag assignment #2208

merged 4 commits into from Oct 2, 2013

Conversation

restebanez
Copy link

hi @geemus,

This PR fixes the tags assignment when an auto scaling group is created. It now accepts a hash instead of an array of hashes.

Rodrigo

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 4576b38 on restebanez:aws_autoscaling/fix-group-creation into 31f74ce on fog:master.

options["Tags.member.#{i+1}.#{key}"] = value unless value.nil?
end
i=0
tags.each do |key, value|
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like you could still use each_with_index here, just without the inner each loop.

Copy link
Member

Choose a reason for hiding this comment

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

I think each_with_index would be a bit cleaner, just need to ensure you do index+1 since it starts at 1.

Copy link
Author

Choose a reason for hiding this comment

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

Good idea!

@geemus
Copy link
Member

geemus commented Oct 1, 2013

@restebanez I'm not sure if I follow the issue related to defaults. Could you explain an example maybe? Thanks!

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 4bf665b on restebanez:aws_autoscaling/fix-group-creation into 31f74ce on fog:master.

@restebanez
Copy link
Author

I noticed the error in a one month old branch, i didn't realize that it was solved 12 days ago: #2161. Sorry for the confusion.

The tags problem wasn't fixed so i'll keep the PR with that part

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 557204e on restebanez:aws_autoscaling/fix-group-creation into 31f74ce on fog:master.

@geemus
Copy link
Member

geemus commented Oct 2, 2013

@restebanez - no problem, just wanted to focus on the problem-at-hand if possible. Thanks!

geemus added a commit that referenced this pull request Oct 2, 2013
…eation

Aws autoscaling/fix tag assignment
@geemus geemus merged commit b490406 into fog:master Oct 2, 2013
@tlunter
Copy link

tlunter commented Nov 12, 2013

So since this now takes just a hash, the other possible parameters can't be sent to AWS. Also, the documentation wasn't fixed above and is now wrong.

This seems more detrimental than good.

@tlunter
Copy link

tlunter commented Nov 12, 2013

Also, it seems that the mock in this case is also quite wrong. The result from AWS would be what was originally being passed in: An array of hashes. What's being passed in is now just a hash. There should be logic around this.

@geemus
Copy link
Member

geemus commented Nov 12, 2013

@tlunter not sure I follow, at a glance at least it appears that the non-tag parameters should go through as before. Could you elaborate on what I missed so I can work to fix it? Thanks.

@tlunter
Copy link

tlunter commented Nov 12, 2013

@geemus
Previously the data structure for tags looked like:

[
  {
    'Key' => 'my_key',
    'Value' => 'my_value',
    'PropagateAtLaunch' => 'false',
    'ResourceId' => '',
    'ResourceType' => ''
  }
]

Now all of these weren't necessary every time, but should anyone wish to change values they are now locked out of it. Also, the response from describe_auto_scaling_groups comes back like this, not as a hash like

{
   'Key' => 'Value'
}

The mock in this case is incorrect since the mapping of tags changes on the response. The Real response has tags mapped like the top version, but the Mock response has tags like the bottom.

My comment on the documentation being wrong is directly tied to the Tags portion.

@geemus
Copy link
Member

geemus commented Nov 13, 2013

@tlunter got it. Would you be up for helping us fix it?

@tlunter
Copy link

tlunter commented Nov 14, 2013

I'll be taking a look into it.

@geemus
Copy link
Member

geemus commented Nov 15, 2013

Awesome, thank you.

On Thu, Nov 14, 2013 at 8:39 AM, Todd Lunter notifications@github.comwrote:

I'll be taking a look into it.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2208#issuecomment-28488409
.

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

5 participants