staypuft 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzQ3MmEzM2QyZmU1YmJhYzkxYjY2NWNhZWE5NGE3ZjNhY2M3Zjk2MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmQxYjQ4MmI4YTAzMjYwMmIwOWYwZGU2ZDZjMmIzOTQwMjkxNmYwYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGJlYjI5MmRkYjE5MDBlMTEwNWIwNzdlYmUyOTU4NTNkOGQ4MDgxNzJiNDc3
|
10
|
+
OGU2YzQ1NjBiNjMxMmYzMWVhNWNmYWFhN2E4YjEwYzUwN2FiYmYyZGY1ODU3
|
11
|
+
ZmJlNzBiZWU5ODZkMWU4YzBmMjA2OWRkYTE4ZDU1YWY1MjlmZWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGMwZjBjMjM0MWFmOWI5NzA3ZDczYzgzNmNmMmI1MWQzMmJjNTk5YzMyNTM2
|
14
|
+
YzMxZTcwZTJmOWYzYjQ4ZDA0NmE4OTJjZjdjOWI5YmI0NzRlZTUwM2E4MGZj
|
15
|
+
M2ViMDY3YmQ2ZTJhYmU1M2UyODQyOTA5NjI1YTE3OTJiMWYyNjk=
|
@@ -7,6 +7,7 @@ module Staypuft
|
|
7
7
|
@subnet = Subnet.find(params[:subnet_id])
|
8
8
|
check_for_existing_assignments
|
9
9
|
check_for_ip_management
|
10
|
+
check_public_api_for_default_gateway
|
10
11
|
check_for_unsharable_subnet_types
|
11
12
|
@subnet_typing = @deployment.subnet_typings.new(:subnet_id => @subnet.id, :subnet_type_id => @subnet_type.id)
|
12
13
|
@saved = @errors.blank? ? @subnet_typing.save : false
|
@@ -20,6 +21,7 @@ module Staypuft
|
|
20
21
|
@subnet = Subnet.find(params[:subnet_id])
|
21
22
|
check_for_existing_assignments
|
22
23
|
check_for_ip_management
|
24
|
+
check_public_api_for_default_gateway
|
23
25
|
check_for_unsharable_subnet_types
|
24
26
|
@subnet_typing.subnet = @subnet
|
25
27
|
@saved = @errors.blank? ? @subnet_typing.save : false
|
@@ -63,7 +65,7 @@ module Staypuft
|
|
63
65
|
def check_for_unsharable_subnet_types
|
64
66
|
# if subnet type is unsharable, make sure nothing else is already assigned here
|
65
67
|
if @subnet_type.dedicated_subnet
|
66
|
-
if @deployment.subnet_typings.where(:subnet_id => @subnet.id).size > 0
|
68
|
+
if @deployment.subnet_typings.where(:subnet_id => @subnet.id).size > 0
|
67
69
|
@errors[@subnet_type.name] = ["Subnet cannot be shared with other traffic types in this deployment."]
|
68
70
|
false
|
69
71
|
else
|
@@ -72,7 +74,7 @@ module Staypuft
|
|
72
74
|
#otherwise make sure there's no existing unsharable type already here
|
73
75
|
else
|
74
76
|
existing_dedicated_types = @deployment.subnet_typings.includes(:subnet_type).where(:subnet_id => @subnet.id, "staypuft_subnet_types.dedicated_subnet" => true)
|
75
|
-
if existing_dedicated_types.size > 0
|
77
|
+
if existing_dedicated_types.size > 0
|
76
78
|
@errors[existing_dedicated_types.first.subnet_type.name] = ["Subnet cannot be shared with other traffic types in this deployment."]
|
77
79
|
false
|
78
80
|
else
|
@@ -80,5 +82,11 @@ module Staypuft
|
|
80
82
|
end
|
81
83
|
end
|
82
84
|
end
|
85
|
+
|
86
|
+
def check_public_api_for_default_gateway
|
87
|
+
if @subnet_type.name == Staypuft::SubnetType::PUBLIC_API && @subnet.gateway.empty?
|
88
|
+
@errors[@subnet_type.name] = ["Subnet must have a default gateway defined."]
|
89
|
+
end
|
90
|
+
end
|
83
91
|
end
|
84
92
|
end
|
data/lib/staypuft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staypuft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Staypuft team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|