Revision aaccdf92 src/sunstone/models/OpenNebulaJSON/HostJSON.rb

View differences:

src/sunstone/models/OpenNebulaJSON/HostJSON.rb
26 26
                return host_hash
27 27
            end
28 28

  
29
            self.allocate(host_hash['name'],
29
            id = self.allocate(host_hash['name'],
30 30
                          host_hash['im_mad'],
31 31
                          host_hash['vm_mad'],
32 32
                          host_hash['cluster_id'].to_i)
33
            delete_values = ['name', 'im_mad', 'vm_mad', 'cluster_id']
34

  
35
            template_str = hash_to_str(host_hash, delete_values)
36
            if !template_str.nil?
37
                params=Hash.new
38
                params['template_raw'] = template_str
39
                params['append'] = true
40
                self.update(params)
41
            end
33 42
        end
34 43

  
35 44
        def delete

Also available in: Unified diff