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

fix default_security_group detection #348

Merged
merged 2 commits into from
Nov 9, 2017
Merged

Conversation

lanej
Copy link
Member

@lanej lanej commented Feb 24, 2017

Match on the correct description.

Fixes #347

@lanej
Copy link
Member Author

lanej commented Feb 27, 2017

Moving default security group creation to create_vpc solves only half the problem. Security groups are currently stored in a hash with the key being the name. However, security group name is not unique.

<Fog::Compute::AWS::SecurityGroup
        name="default",
        description="default VPC security group",
        group_id="sg-2c2dfc56",
        ip_permissions=[{"groups"=>[{"userId"=>"362331042830", "groupId"=>"sg-2c2dfc56"}], "ipRanges"=>[], "ipProtocol"=>"-1"}],
        ip_permissions_egress=[{"groups"=>[], "ipRanges"=>[{"cidrIp"=>"0.0.0.0/0"}], "ipProtocol"=>"-1"}],
        owner_id="362331042830",
        vpc_id="vpc-a25b26c5",
        tags={}
      >,
<Fog::Compute::AWS::SecurityGroup
        name="default",
        description="default VPC security group",
        group_id="sg-39706345",
        ip_permissions=[{"groups"=>[{"userId"=>"362331042830", "groupId"=>"sg-39706345"}], "ipRanges"=>[], "ipProtocol"=>"-1"}],
        ip_permissions_egress=[{"groups"=>[], "ipRanges"=>[{"cidrIp"=>"0.0.0.0/0"}], "ipProtocol"=>"-1"}],
        owner_id="362331042830",
        vpc_id="vpc-a6136bc0",
        tags={}
      >,

I will overhaul the mock security group storage but it will be a substantial change.

Create default security groups when the vpc is created.  This prevents
sequencing issues in the tests.
This prevents group name collisions.  Specfically, default security
group name collisions
@lanej
Copy link
Member Author

lanej commented Nov 8, 2017

I've finished overhauling the (tested) mock files to key off of groupId rather than groupName.

Copy link
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

👍 looks good to me, thanks for checking in

@lanej lanej merged commit 16be496 into fog:master Nov 9, 2017
@geemus
Copy link
Member

geemus commented Nov 9, 2017 via email

@lanej lanej deleted the lanej/fix-efs-test branch November 9, 2017 16:47
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.

2 participants