staypuft 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffc4713af541fbd45de1031951ef127af36cc43d
4
- data.tar.gz: 74e411dad81c3260b1d636be7728443c7488863a
3
+ metadata.gz: 18a9a8aa4dbeac91c1b58bd703873461aa53198a
4
+ data.tar.gz: 8a8311dcb6ff38ffa3fa6f3286538059b362be15
5
5
  SHA512:
6
- metadata.gz: 25789e7b3464ad1bdb69777ff80f23f9c5723d33e2c26f544f661f5c00eadd6bba7a3fd65dda4a7a8f25aa060792839fccd30eaee5b8867d5d994d78a28c0c1d
7
- data.tar.gz: 227301210b654338dc414554bc5b32684ca0719052261003227f05f06e0ec75f850a975ce1702710f844b558f184a11470d61f01234ca708306a3c6977e2e8e2
6
+ metadata.gz: 1ccd0d9a1e917e1820912ef93553713841fd9d98cad32416ee10782f76de0fab095aa39669b2d209a26155e19a52a25a5781173484177dd6d229f41e27305754
7
+ data.tar.gz: 76ec7bc0494fecbf09bd96ca9ca24648d6d17c6f47dc8aa8210697e1eddedf2ddffc789c818e5c6328b450ce4801c77103a65f85121071723fed463b26216841
@@ -3,7 +3,9 @@ module Staypuft
3
3
  layout false
4
4
  def index
5
5
  @deployment = Deployment.find(params[:deployment_id])
6
- @hosts = Host::Managed.where(:id => params[:host_ids]).includes(:interfaces)
6
+ host_ids = params[:host_ids]
7
+ host_ids = host_ids.split(',') unless host_ids.is_a? Array
8
+ @hosts = Host::Managed.where(:id => host_ids).includes(:interfaces)
7
9
  @subnets = @deployment.subnets.uniq
8
10
  @host = @hosts.first
9
11
  @interfaces = @host ? @host.interfaces.where("type <> 'Nic::BMC'").non_vip.order(:identifier).physical : []
@@ -23,7 +25,9 @@ module Staypuft
23
25
  def create
24
26
  @errors = {}
25
27
  @deployment = Deployment.find(params[:deployment_id])
26
- @hosts = Host::Managed.where(:id => params[:host_ids])
28
+ host_ids = params[:host_ids]
29
+ host_ids = host_ids.split(',') unless host_ids.is_a? Array
30
+ @hosts = Host::Managed.where(:id => host_ids)
27
31
  @hosts.each do |host|
28
32
  @interface = host.interfaces.find_by_identifier(params[:interface]) || host
29
33
  @subnet = Subnet.find(params[:subnet_id])
@@ -37,7 +41,9 @@ module Staypuft
37
41
  def destroy
38
42
  @errors = {}
39
43
  @deployment = Deployment.find(params[:deployment_id])
40
- @hosts = Host::Managed.where(:id => params[:host_ids])
44
+ host_ids = params[:host_ids]
45
+ host_ids = host_ids.split(',') unless host_ids.is_a? Array
46
+ @hosts = Host::Managed.where(:id => host_ids)
41
47
  @hosts.each do |host|
42
48
  @interface = host.interfaces.find_by_identifier(params[:interface]) || host
43
49
  @subnet = Subnet.find(params[:subnet_id])
@@ -71,7 +77,7 @@ module Staypuft
71
77
  end
72
78
 
73
79
  def get_interfaces_to_compare(host)
74
- host.interfaces.where("type <> 'Nic::BMC'").order(:identifier)
80
+ host.interfaces.non_vip.where("type <> 'Nic::BMC'").order(:identifier)
75
81
  end
76
82
  end
77
83
  end
@@ -58,7 +58,7 @@ module Staypuft
58
58
  end
59
59
 
60
60
  def controller_ip(subnet_type_name)
61
- ip_for_host(controllers.tap { |v| v.size == 1 or raise }.first, subnet_type_name)
61
+ ip_for_host(controllers.tap { |v| v.size == 1 or raise('only one controller is allowed') }.first, subnet_type_name)
62
62
  end
63
63
 
64
64
  def controller_fqdns
@@ -148,14 +148,14 @@ module Staypuft
148
148
  if self.deployment.ha?
149
149
  params.delete :backend_lvm
150
150
  end
151
- unless params.detect(lambda { false }) { |field| field }
152
- errors[:base] << _("At least one storage backend must be selected")
151
+ unless params.detect(lambda { false }) { |field| self.send(field) == "true" }
152
+ errors.add :base, _("At least one storage backend must be selected")
153
153
  end
154
154
  end
155
155
 
156
156
  def equallogic_backends
157
157
  unless self.eqlxs.all? { |item| item.valid? }
158
- errors[:base] << _("Please fix the problems in selected backends")
158
+ errors.add :base, _("Please fix the problems in selected backends")
159
159
  end
160
160
  end
161
161
  end
@@ -2,7 +2,8 @@
2
2
  <h5><%= _(Staypuft::Deployment::CinderService::DriverBackend::HUMAN) %></h5>
3
3
  <div class="col-md-12 clearfix cinderPicker" id="cinderPicker">
4
4
  <%= f.fields_for :cinder, @deployment.cinder do |p| %>
5
-
5
+ <%= base_errors_for @deployment.cinder %>
6
+ <div class="form-group <%= @deployment.cinder.errors.empty? ? "" : 'has-error' %> hide"></div>
6
7
  <%= check_box_f_non_inline(p, :backend_nfs,
7
8
  :checked_value => 'true',
8
9
  :unchecked_value => 'false',
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
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.3.2
4
+ version: 0.3.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-09-08 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks