lib/client/template_api.rb in rbovirt-0.0.15 vs lib/client/template_api.rb in rbovirt-0.0.16
- old
+ new
@@ -1,10 +1,11 @@
module OVIRT
class Client
def templates(opts={})
- search= opts[:search] || ("datacenter=%s" % current_datacenter.name)
- http_get("/templates?search=%s" % CGI.escape(search)).xpath('/templates/template').collect do |t|
+ path = "/templates"
+ path += search_url(opts) unless filtered_api
+ http_get(path).xpath('/templates/template').collect do |t|
OVIRT::Template::new(self, t)
end.compact
end
def template(template_id, opts={})
@@ -32,6 +33,6 @@
http_get("/templates/%s/disks" % template_id, http_headers).xpath('/disks/disk').collect do |disk|
OVIRT::Volume::new(self, disk)
end
end
end
-end
\ No newline at end of file
+end