1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[xenserver] missing Pool model attribute, new methods

- Added missing suspend_image_sr attribute
- added default_sr getter/setter
- added suspend_image_sr getter/setter
- added generic set_attribute method
This commit is contained in:
Sergio Rubio 2012-12-31 00:50:55 +01:00
parent 01c0669f5b
commit 64612868da

View file

@ -19,19 +19,41 @@ module Fog
attribute :restrictions
attribute :ha_enabled
attribute :vswitch_controller
attribute :__suspend_image_sr, :aliases => :suspend_image_SR
def default_sr
connection.storage_repositories.get __default_sr
end
def default_sr=(sr)
connection.set_attribute( 'pool', reference, 'default_SR', sr.reference )
end
alias :default_storage_repository= :default_sr=
def default_storage_repository
default_sr
end
def suspend_image_sr=(sr)
connection.set_attribute( 'pool', reference, 'suspend_image_SR', sr.reference )
end
def suspend_image_sr
connection.storage_repositories.get __suspend_image_sr
end
def master
connection.hosts.get __master
end
def set_attribute(name, *val)
data = connection.set_attribute( 'pool', reference, name, *val )
# Do not reload automatically for performance reasons
# We can set multiple attributes at the same time and
# then reload manually
#reload
end
end