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:
parent
01c0669f5b
commit
64612868da
1 changed files with 22 additions and 0 deletions
|
@ -19,19 +19,41 @@ module Fog
|
||||||
attribute :restrictions
|
attribute :restrictions
|
||||||
attribute :ha_enabled
|
attribute :ha_enabled
|
||||||
attribute :vswitch_controller
|
attribute :vswitch_controller
|
||||||
|
attribute :__suspend_image_sr, :aliases => :suspend_image_SR
|
||||||
|
|
||||||
|
|
||||||
def default_sr
|
def default_sr
|
||||||
connection.storage_repositories.get __default_sr
|
connection.storage_repositories.get __default_sr
|
||||||
end
|
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
|
def default_storage_repository
|
||||||
default_sr
|
default_sr
|
||||||
end
|
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
|
def master
|
||||||
connection.hosts.get __master
|
connection.hosts.get __master
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue