staypuft 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/staypuft/concerns/hosts_api_extensions.rb +6 -4
- data/app/controllers/staypuft/concerns/hosts_controller_extensions.rb +7 -4
- data/app/controllers/staypuft/interface_assignments_controller.rb +1 -0
- data/app/overrides/foreman_hosts_edit.rb +2 -1
- data/app/overrides/select_multiple_systems_hostgroup.rb +2 -1
- data/app/views/staypuft/interface_assignments/_nics_assignment.html.erb +1 -1
- data/lib/staypuft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDMxMmJlMWYzNTNkM2ZiZDdlZjQ3ODllNjAxNTYxOTM2OWU0ZDRlNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzQ4ZmMzNmMzMGM0NTZmMWZmZDNhNTE4NWNkNTJmZmI0MmZkM2FmNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E4MGMxMjY4N2ViMjc3NzBkYWM1ZTJkYmY0N2Q4ODQ1YjM1MTc4ZTcxZmE3
|
10
|
+
ZWQzOGRmOTgzZmQ5YjhmM2ZlOTc2NWM4NDhjMzE5ODg2MTI0MTk3NTU5MTVl
|
11
|
+
MGIyYzcyMzY5ODk0ZDMzMmViMWEzYzI3NTM3Y2NjZWE4ODk4ZTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDQwYTczZmI5NDI5M2Q5NmM1MWZlODk3Njc2YmVhMGU4MzgzM2Y1MTVkM2U1
|
14
|
+
NTZjNDE0NmY0MGM0NTE5YmIyYmI3MWMwNTVmOWYxODVlOGRlZmE3MTJjNDAy
|
15
|
+
NmNhYWZkMGQxZjM2MTNkNTU5MTMxMzdjNjkwZGM5MDhjYzc2MWU=
|
@@ -2,16 +2,18 @@ module Staypuft::Concerns::HostsApiExtensions
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
|
5
|
+
before_filter :check_openstack_hostgroup, only: [:create, :update]
|
6
6
|
end
|
7
7
|
|
8
8
|
def check_openstack_hostgroup
|
9
9
|
if params[:host] and params[:host][:hostgroup_id]
|
10
10
|
hostgroup_id = params[:host][:hostgroup_id]
|
11
11
|
hg = Hostgroup.find(hostgroup_id)
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
unless @host.deployment and @host.hostgroup == hg
|
13
|
+
if hg.ancestors.include? Hostgroup.get_base_hostgroup
|
14
|
+
Rails.logger.error "Cannot set a deployment hostgroup directly."
|
15
|
+
render :json => {:error => _('Cannot set a deployment hostgroup directly.') }, :status => :forbidden
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -9,10 +9,13 @@ module Staypuft::Concerns::HostsControllerExtensions
|
|
9
9
|
def check_openstack_hostgroup
|
10
10
|
if params[:host] and params[:host][:hostgroup_id]
|
11
11
|
hostgroup_id = params[:host][:hostgroup_id]
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
hostgroup = Hostgroup.find(hostgroup_id)
|
13
|
+
unless hostgroup.deployment and @host.hostgroup == hostgroup
|
14
|
+
if openstack_hostgroup? hostgroup_id
|
15
|
+
Rails.logger.error "Cannot set a deployment hostgroup directly."
|
16
|
+
error _('Invalid host group selected! Cannot select OpenStack deployment host group.')
|
17
|
+
render :action => :edit and return
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -28,7 +28,8 @@ Deface::Override.new(:virtual_path => "hosts/_form",
|
|
28
28
|
:replace => "#{erb_tag}:contains(':hostgroup_id')",
|
29
29
|
:original => '04903c858c6f96ed5c015cac5960e02708d8fea8'
|
30
30
|
) do
|
31
|
-
"
|
31
|
+
" <% hostgroups = accessible_hostgroups.reject { |hg| hg.to_label =~ /\#{Setting[:base_hostgroup]}\\/.*/ && hg.to_label != @host.hostgroup.to_label } %>
|
32
|
+
<%= select_f f, :hostgroup_id, hostgroups, :id, :to_label,
|
32
33
|
{ :include_blank => true},
|
33
34
|
{ :onchange => 'hostgroup_changed(this);', :'data-host-id' => @host.id,
|
34
35
|
:'data-url' => (@host.new_record? || @host.type_changed?) ? process_hostgroup_hosts_path : hostgroup_or_environment_selected_hosts_path,
|
@@ -10,6 +10,7 @@ Deface::Override.new(:virtual_path => "hosts/select_multiple_hostgroup",
|
|
10
10
|
:replace => "#{erb_tag}:contains(':id')",
|
11
11
|
:original => '<%= selectable_f f, :id, [[_("Select host group"),"disabled"],[_("*Clear host group*"), "" ]] + Hostgroup.all.map{|h| [h.to_label, h.id]}.sort,{}, :onchange => "toggle_multiple_ok_button(this)" %>'
|
12
12
|
) do
|
13
|
-
"
|
13
|
+
" <% hostgroups = accessible_hostgroups.reject { |hg| hg.to_label =~ /\#{Setting[:base_hostgroup]}\\/.*/ } %>
|
14
|
+
<%= selectable_f f, :id, [[_(\"Select host group\"),\"disabled\"],[_(\"*Clear host group*\"), \"\" ]] + hostgroups.map{|h| [h.to_label, h.id]}.sort,{},
|
14
15
|
:onchange => \"toggle_multiple_ok_button(this)\" %>"
|
15
16
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="panel-body">
|
6
6
|
<% @subnets.each do |subnet| %>
|
7
7
|
<% next if is_pxe?(@deployment, subnet) # we skip PXE network which is always on primary interface %>
|
8
|
-
<% next if @host.interfaces.
|
8
|
+
<% next if @host.interfaces.non_vip.where(:subnet_id => subnet.id).present? # we skip assigned subnets %>
|
9
9
|
<%= render 'staypuft/subnets/subnet_pull',
|
10
10
|
:subnet => subnet,
|
11
11
|
:deployment => @deployment,
|
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.7
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|