Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #16 from satoruh/master
Browse files Browse the repository at this point in the history
Raise exception if ip_ranges or groups have duplicate values.
  • Loading branch information
Genki Sugawara committed Jul 26, 2015
2 parents 5b5a3d4 + 1f3f9b1 commit 686f554
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/piculet/dsl/permission.rb
Expand Up @@ -38,6 +38,10 @@ def ip_ranges(*values)
end
end

if values.size != values.uniq.size
raise "SecurityGroup `#{@security_group}\: #{@direction}: #{@protocol_prot_range}: `ip_ranges`: duplicate ip ranges"
end

@result.ip_ranges = values
end

Expand All @@ -52,6 +56,10 @@ def groups(*values)
end
end

if values.size != values.uniq.size
raise "SecurityGroup `#{@security_group}\: #{@direction}: #{@protocol_prot_range}: `groups`: duplicate groups"
end

@result.groups = values
end
end # Permission
Expand Down

0 comments on commit 686f554

Please sign in to comment.