mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1552 from smgt/glesys-server-attribute-fix
[glesys] Attributes were overwritten when getting server details
This commit is contained in:
commit
564176e284
2 changed files with 9 additions and 5 deletions
|
@ -14,11 +14,8 @@ module Fog
|
||||||
attribute :cpucores
|
attribute :cpucores
|
||||||
attribute :memorysize
|
attribute :memorysize
|
||||||
attribute :disksize
|
attribute :disksize
|
||||||
attribute :cpu
|
|
||||||
attribute :memory
|
|
||||||
attribute :disk
|
|
||||||
attribute :uptime
|
|
||||||
attribute :transfer
|
attribute :transfer
|
||||||
|
attribute :uptime
|
||||||
attribute :templatename
|
attribute :templatename
|
||||||
attribute :managedhosting
|
attribute :managedhosting
|
||||||
attribute :platform
|
attribute :platform
|
||||||
|
@ -27,6 +24,7 @@ module Fog
|
||||||
attribute :state
|
attribute :state
|
||||||
attribute :iplist
|
attribute :iplist
|
||||||
attribute :description
|
attribute :description
|
||||||
|
attribute :usage
|
||||||
attribute :glera_enabled, :aliases => "gleraenabled"
|
attribute :glera_enabled, :aliases => "gleraenabled"
|
||||||
attribute :supported_features, :aliases => "supportedfeatures"
|
attribute :supported_features, :aliases => "supportedfeatures"
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,14 @@ module Fog
|
||||||
if details.empty? || status.empty?
|
if details.empty? || status.empty?
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
status['server'].merge!({ :serverid => identifier})
|
details['server']['usage'] = Hash.new
|
||||||
|
|
||||||
|
%w|cpu memory disk transfer|.each do |attr|
|
||||||
|
details['server']['usage'][attr] = status['server'].delete(attr)
|
||||||
|
end
|
||||||
|
|
||||||
details['server'].merge!(status['server'])
|
details['server'].merge!(status['server'])
|
||||||
|
|
||||||
new(details['server'])
|
new(details['server'])
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue