staypuft 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/staypuft/deployment/cinder_service.rb +8 -3
- data/app/models/staypuft/deployment/glance_service.rb +7 -3
- data/app/models/staypuft/deployment/ip_address_validator.rb +2 -22
- data/app/models/staypuft/deployment/ip_check.rb +28 -0
- data/app/models/staypuft/deployment/nfs_uri_validator.rb +17 -0
- data/app/views/staypuft/deployments/_deployment_overview.html.erb +9 -9
- data/lib/staypuft/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGUyNWNiM2M0NjZkMTZiMDRiN2ExNjdmNTEzYTU3MDQwY2EzYThlZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzI0ZTY4Y2UzZGM3MzI2MTU3OTkzMjE0NTU5MmVlMmM5YzU5MTYyMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTEzNjU2YzIyY2JiNDc1MTYzNGZhYzBlNjFkZGI4ZGI5YmY1YTc3MTdjMDBj
|
10
|
+
MTJmZTExNjMwZjZkNGRkMWUzZTM1NzJkZDZkMmRmMWQzZjIxNTI2MWJhZTlk
|
11
|
+
ODU4MWJlYjk5ODEyZTZkM2IzNTBlZGE2ZDc5ZGJhNmMwMTgyYjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmRlYTkyMDkyOTY1MWViYzgyNDliNzM5ZTdhODYxMmU5NzYwMTE2NGIxYWI2
|
14
|
+
M2JlNGNlZjRhOWI4MTY5MWMwN2ZkMzcwODdlNmJlZTQwYmQxOTA5MjRjZTdh
|
15
|
+
Y2UxNmZiYzZhNzlhYWQ3NWQxN2YwMmIzMjI1YWI4ZTg0YWZiMWQ=
|
@@ -31,10 +31,15 @@ module Staypuft
|
|
31
31
|
HUMAN = N_('NFS URI:')
|
32
32
|
HUMAN_AFTER = Deployment::GlanceService::NFS_HELP
|
33
33
|
end
|
34
|
+
|
35
|
+
class NfsUriValueValidator < ActiveModel::EachValidator
|
36
|
+
include Staypuft::Deployment::NfsUriValidator
|
37
|
+
end
|
38
|
+
|
34
39
|
validates :nfs_uri,
|
35
|
-
:presence
|
36
|
-
:if
|
37
|
-
|
40
|
+
:presence => true,
|
41
|
+
:if => :nfs_backend?,
|
42
|
+
:nfs_uri_value => true
|
38
43
|
|
39
44
|
module SanIp
|
40
45
|
HUMAN = N_('SAN IP Addr:')
|
@@ -28,10 +28,14 @@ module Staypuft
|
|
28
28
|
HUMAN_AFTER = NFS_HELP
|
29
29
|
end
|
30
30
|
|
31
|
+
class NfsNetworkPathValueValidator < ActiveModel::EachValidator
|
32
|
+
include Staypuft::Deployment::NfsUriValidator
|
33
|
+
end
|
34
|
+
|
31
35
|
validates :nfs_network_path,
|
32
|
-
:presence
|
33
|
-
:if
|
34
|
-
|
36
|
+
:presence => true,
|
37
|
+
:if => :nfs_backend?,
|
38
|
+
:nfs_network_path_value => true
|
35
39
|
|
36
40
|
class Jail < Safemode::Jail
|
37
41
|
allow :driver_backend, :pcmk_fs_type, :pcmk_fs_device, :pcmk_fs_options, :backend,
|
@@ -1,30 +1,10 @@
|
|
1
1
|
module Staypuft
|
2
2
|
module Deployment::IpAddressValidator
|
3
|
-
|
4
|
-
INVALID_IP_OR_FQDN_MSG = N_("Invalid IP address or FQDN supplied")
|
3
|
+
include Staypuft::Deployment::IpCheck
|
5
4
|
|
6
5
|
def validate_each(record, attribute, value)
|
7
6
|
return if value.empty?
|
8
|
-
|
9
|
-
begin
|
10
|
-
ip_addr = IPAddr.new(value)
|
11
|
-
ip_range = ip_addr.to_range
|
12
|
-
if ip_range.begin == ip_range.end
|
13
|
-
true
|
14
|
-
else
|
15
|
-
record.errors.add attribute, NOT_RANGE_MSG
|
16
|
-
false
|
17
|
-
end
|
18
|
-
rescue
|
19
|
-
# not IP addr
|
20
|
-
# validating as fqdn
|
21
|
-
if /(?=^.{1,254}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(?<!-))|((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63})$)/ =~ value
|
22
|
-
true
|
23
|
-
else
|
24
|
-
record.errors.add attribute, INVALID_IP_OR_FQDN_MSG
|
25
|
-
false
|
26
|
-
end
|
27
|
-
end
|
7
|
+
check_ip_or_hostname(record, attribute, value)
|
28
8
|
end
|
29
9
|
end
|
30
10
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Staypuft
|
2
|
+
module Deployment::IpCheck
|
3
|
+
NOT_RANGE_MSG = N_("Specify single IP address, not range")
|
4
|
+
INVALID_IP_OR_FQDN_MSG = N_("Invalid IP address or FQDN supplied")
|
5
|
+
|
6
|
+
def check_ip_or_hostname(record, attribute, value)
|
7
|
+
begin
|
8
|
+
ip_addr = IPAddr.new(value)
|
9
|
+
ip_range = ip_addr.to_range
|
10
|
+
if ip_range.begin == ip_range.end
|
11
|
+
true
|
12
|
+
else
|
13
|
+
record.errors.add attribute, NOT_RANGE_MSG
|
14
|
+
false
|
15
|
+
end
|
16
|
+
rescue
|
17
|
+
# not IP addr
|
18
|
+
# validating as fqdn
|
19
|
+
if /(?=^.{1,254}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(?<!-))|((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63})$)/ =~ value
|
20
|
+
true
|
21
|
+
else
|
22
|
+
record.errors.add attribute, INVALID_IP_OR_FQDN_MSG
|
23
|
+
false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Staypuft
|
2
|
+
module Deployment::NfsUriValidator
|
3
|
+
include Staypuft::Deployment::IpCheck
|
4
|
+
|
5
|
+
INVALID_URI_MESSAGE = N_('Specify NFS URI as <server>:<local path>')
|
6
|
+
def validate_each(record, attribute, value)
|
7
|
+
return if value.empty?
|
8
|
+
match = /(.+):(.+)/.match(value)
|
9
|
+
if match
|
10
|
+
check_ip_or_hostname(record, attribute, match[1])
|
11
|
+
else
|
12
|
+
record.errors.add attribute, INVALID_URI_MESSAGE
|
13
|
+
false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -8,12 +8,12 @@
|
|
8
8
|
<% @deployment.child_hostgroups.deploy_order.each_with_index do |child_hostgroup, i| %>
|
9
9
|
<li>
|
10
10
|
<div class="col-xs-2">
|
11
|
-
<% if child_hostgroup.hosts.select { |h|
|
11
|
+
<% if child_hostgroup.hosts.select { |h| !@deployment.in_progress? && h.open_stack_deployed? }.count > 0 %>
|
12
12
|
<a href="#<%= child_hostgroup.name.parameterize.underscore %>_deployed_hosts" data-toggle="tab" class="roles_list">
|
13
|
-
<span><%= child_hostgroup.hosts.select { |h|
|
13
|
+
<span><%= child_hostgroup.hosts.select { |h| !@deployment.in_progress? && h.open_stack_deployed? }.count %></span>
|
14
14
|
</a>
|
15
15
|
<% else %>
|
16
|
-
<span><%= child_hostgroup.hosts.select { |h|
|
16
|
+
<span><%= child_hostgroup.hosts.select { |h| !@deployment.in_progress? && h.open_stack_deployed? }.count %></span>
|
17
17
|
<% end %>
|
18
18
|
</div>
|
19
19
|
<div class="col-xs-6">
|
@@ -22,14 +22,14 @@
|
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<div class="col-xs-2">
|
25
|
-
<% if child_hostgroup.hosts.select { |h| !(
|
25
|
+
<% if child_hostgroup.hosts.select { |h| !(!@deployment.in_progress? && h.open_stack_deployed?) }.count > 0 %>
|
26
26
|
<a href="#<%= child_hostgroup.name.parameterize.underscore %>_assigned_hosts" data-toggle="tab" class="roles_list">
|
27
|
-
<%
|
28
|
-
<i class="glyphicon glyphicon-time"></i>
|
29
|
-
<% else %>
|
27
|
+
<% if child_hostgroup.hosts.select { |h| (@deployment.in_progress? && h.open_stack_deployed?) }.count > 0 %>
|
30
28
|
<%= image_tag '/assets/spinner.gif' %>
|
29
|
+
<% else %>
|
30
|
+
<i class="glyphicon glyphicon-time"></i>
|
31
31
|
<% end %>
|
32
|
-
<span><%= child_hostgroup.hosts.select { |h| !(
|
32
|
+
<span><%= child_hostgroup.hosts.select { |h| !(!@deployment.in_progress? && h.open_stack_deployed?) }.count %></span>
|
33
33
|
</a>
|
34
34
|
<% end %>
|
35
35
|
</div>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
<%= render 'deployed_hosts_table', :deployment => @deployment,
|
56
56
|
:hostgroup => @hostgroup,
|
57
57
|
:child_hostgroup => child_hostgroup,
|
58
|
-
:hosts => child_hostgroup.hosts.select { |h|
|
58
|
+
:hosts => child_hostgroup.hosts.select { |h| !@deployment.in_progress? && h.open_stack_deployed? } %>
|
59
59
|
<% end %>
|
60
60
|
<%= render :partial => "deployment_summary", :locals => { :deployment => @deployment } %>
|
61
61
|
</div>
|
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.5.
|
4
|
+
version: 0.5.3
|
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-12-
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|
@@ -160,8 +160,10 @@ files:
|
|
160
160
|
- app/models/staypuft/deployment/cinder_service/equallogic.rb
|
161
161
|
- app/models/staypuft/deployment/glance_service.rb
|
162
162
|
- app/models/staypuft/deployment/ip_address_validator.rb
|
163
|
+
- app/models/staypuft/deployment/ip_check.rb
|
163
164
|
- app/models/staypuft/deployment/neutron_service.rb
|
164
165
|
- app/models/staypuft/deployment/neutron_service/cisconexus.rb
|
166
|
+
- app/models/staypuft/deployment/nfs_uri_validator.rb
|
165
167
|
- app/models/staypuft/deployment/nova_service.rb
|
166
168
|
- app/models/staypuft/deployment/passwords.rb
|
167
169
|
- app/models/staypuft/deployment/vlan_range_values_validator.rb
|