Skip to content

Commit

Permalink
B #3280: Import vCenter cluster as host needs to check existing OpenN…
Browse files Browse the repository at this point in the history
…ebula clusters
  • Loading branch information
jmdelafe committed May 7, 2019
1 parent 550ad6d commit 70e7355
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ def create(template_json)
return cluster_hash
end

# Check if cluster exists
cluster_pool = OpenNebula::ClusterPool.new(@client)
cluster_pool.info
cluster_pool.each do |cluster|
if cluster.name == cluster_hash['name']
# Use existing cluster
@pe_id = cluster.id
else
# Create cluster
self.allocate(cluster_hash['name'])
end
end

self.allocate(cluster_hash['name'])
end

Expand Down

1 comment on commit 70e7355

@GitCop
Copy link

@GitCop GitCop commented on 70e7355 May 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

  • Subject must be equal or less than 50

Guidelines are available at https://github.com/OpenNebula/one/blob/master/share/doc/dev/COMMIT_MESSAGES.md


This message was auto-generated by https://gitcop.com

Please sign in to comment.