Method: Fog::Compute::Libvirt::Pool#save

Defined in:
lib/fog/libvirt/models/compute/pool.rb

#saveObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/libvirt/models/compute/pool.rb', line 24

def save
  requires :xml
  unless xml.nil?
    pool=nil
    if self.create_persistent
      pool=connection.raw.define_storage_pool_xml(xml)
    else
      pool=connection.raw.create_storage_pool_xml(xml)
    end
    self.raw=pool
    true
  else
    raise Fog::Errors::Error.new('Creating a new pool requires proper xml')
    false
  end
end