Class: Cloudkeeper::One::Opennebula::TemplateHandler
- Inherits:
-
ApplianceHandler
- Object
- Handler
- ApplianceHandler
- Cloudkeeper::One::Opennebula::TemplateHandler
- Defined in:
- lib/cloudkeeper/one/opennebula/template_handler.rb
Constant Summary
Constants inherited from ApplianceHandler
ApplianceHandler::LEAVE_ID_AS_IS, ApplianceHandler::ONEADMIN_ID
Constants inherited from Handler
Constants included from Helper
Instance Attribute Summary
Attributes inherited from ApplianceHandler
Attributes inherited from Handler
Instance Method Summary collapse
-
#initialize ⇒ TemplateHandler
constructor
A new instance of TemplateHandler.
- #register(template_template, group) ⇒ Object
Methods inherited from ApplianceHandler
#chgrp, #chmod, #delete, #find_by_appliance_id, #find_by_image_list_id, #update
Methods inherited from Handler
#exist?, #find_all, #find_by_id, #find_by_name, #find_one
Methods included from Helper
#decode_error, #handle_opennebula_error
Constructor Details
#initialize ⇒ TemplateHandler
Returns a new instance of TemplateHandler.
5 6 7 8 |
# File 'lib/cloudkeeper/one/opennebula/template_handler.rb', line 5 def initialize super @pool = OpenNebula::TemplatePool.new client end |
Instance Method Details
#register(template_template, group) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cloudkeeper/one/opennebula/template_handler.rb', line 10 def register(template_template, group) template_alloc = OpenNebula::Template.build_xml template = OpenNebula::Template.new(template_alloc, client) handle_opennebula_error { template.allocate template_template } chmod template, Cloudkeeper::One::Settings[:'appliances-permissions'] chgrp template, group template end |