Skip to content

Commit

Permalink
Stop nils from appearing in list of hosts to test OSP ssh keys against
Browse files Browse the repository at this point in the history
  • Loading branch information
mansam committed Jan 10, 2017
1 parent 95e002b commit 3c80a31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/manageiq/providers/openstack/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ def required_credential_fields(type)
end

def verify_ssh_keypair_credentials(_options)
# Select one powered-on host in each cluster to verify
# ssh credentials against
hosts.sort_by(&:ems_cluster_id)
.slice_when { |i, j| i.ems_cluster_id != j.ems_cluster_id }
.map { |c| c.find { |h| h.power_state == 'on' } }
.map { |c| c.find { |h| h.power_state == 'on' } }.compact
.all? { |h| h.verify_credentials('ssh_keypair') }
end
private :verify_ssh_keypair_credentials
Expand Down

0 comments on commit 3c80a31

Please sign in to comment.