[linode|compute] Get number of CPU cores from the API
This commit is contained in:
parent
c54e2d1c24
commit
dcf856b4fb
|
@ -9,31 +9,7 @@ module Fog
|
|||
attribute :name
|
||||
attribute :ram
|
||||
attribute :price
|
||||
|
||||
def cores
|
||||
case id
|
||||
when 1
|
||||
1
|
||||
when 2
|
||||
2
|
||||
when 4
|
||||
4
|
||||
when 6
|
||||
6
|
||||
when 7
|
||||
8
|
||||
when 8
|
||||
12
|
||||
when 9
|
||||
16
|
||||
when 10
|
||||
20
|
||||
when 12
|
||||
20
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
attribute :cores
|
||||
|
||||
def bits
|
||||
0 # these are determined by images you select not the hardware
|
||||
|
|
|
@ -56,6 +56,7 @@ module Fog
|
|||
{ "PRICE" => 19.95, "RAM" => 512, "XFER" => 200,
|
||||
"PLANID" => linodeplan_id, "LABEL" => "Linode #{linodeplan_id}",
|
||||
"DISK" => 20,
|
||||
"CORES" => 1,
|
||||
"AVAIL" => {
|
||||
"3"=>48, "2"=>207, "7"=>161, "6"=>143, "4"=>108, "8"=>60
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ Shindo.tests('Fog::Compute[:linode] | linodeplans requests', ['linode']) do
|
|||
'PRICE' => Float,
|
||||
'RAM' => Integer,
|
||||
'LABEL' => String,
|
||||
'XFER' => Integer
|
||||
'XFER' => Integer,
|
||||
'CORES' => Integer
|
||||
}]
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue