lib/client/cluster_api.rb in rbovirt-0.0.11 vs lib/client/cluster_api.rb in rbovirt-0.0.12
- old
+ new
@@ -7,11 +7,13 @@
def clusters(opts={})
headers = {:accept => "application/xml; detail=datacenters"}
search= opts[:search] || ("datacenter=%s" % current_datacenter.name)
http_get("/clusters?search=%s" % CGI.escape(search), headers).xpath('/clusters/cluster').collect do |cl|
- OVIRT::Cluster.new(self, cl)
- end
+ cluster = OVIRT::Cluster.new(self, cl)
+ #the following line is needed as a work-around a bug in RHEV 3.0 rest-api
+ cluster if cluster.datacenter.id == current_datacenter.id
+ end.compact
end
def cluster(cluster_id)
headers = {:accept => "application/xml; detail=datacenters"}
cluster_xml = http_get("/clusters/%s" % cluster_id, headers)