Skip to content

Commit da9d2cd

Browse files
committed
Merge the 2.2.2 changes into the 3.0 branch
Conflicts: CHANGELOG.textile lib/softlayer/VirtualServer.rb lib/softlayer/base.rb
2 parents 1c978ad + 9d3b67d commit da9d2cd

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

CHANGELOG.textile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
* Added a method to reboot servers.
77
* The routine to retreive the open tickets on an account has been moved from the Ticket class. The set of open tickets is now a dynamic property of an account object.
88

9+
*2.2.2*
10+
* Fixed a bug in BareMetalServerOrder_Package.rb where the order template did not use an array for the "hardware" key. This lead to an order template that would be accepted by verifyOrder, but rejected by placeOrder. An internal issue to review verifyOrder has also been generated. (reported by Rohit Singh)
11+
912
*2.2*
10-
* Added the ability to set a timout for network requests. The timeout is given when a client is created by passing the :timeout hash parameter when creating a client. The value of the parameter is an integer number of seconds.
13+
* Added the ability to set a timout for network requests. The timeout is given when a client is created by passing the :timeout hash parameter when creating a client. The value of the parameter is an integer number of seconds.
14+
* Fixed a bug in VirtualServer#capture_image
1115

1216
*2.1.1*
1317
* Virtual server upgrades no longer raise exceptions

lib/softlayer/BareMetalServerOrder_Package.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def hardware_order
118118
product_order = {
119119
'packageId' => @package.id,
120120
'useHourlyPricing' => false,
121-
'hardware' => {
121+
'hardware' => [{
122122
'hostname' => @hostname,
123123
'domain' => @domain
124-
}
124+
}]
125125
}
126126

127127
product_order['location'] = @datacenter.id if @datacenter

lib/softlayer/VirtualServer.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,16 @@ def cancel!
8787
# You may use the wait_until_ready routine of SoftLayer::ImageTemplate to
8888
# wait on it.
8989
#
90-
def capture_image(image_name, include_attached_storage = false, image_notes = nil)
90+
def capture_image(image_name, include_attached_storage = false, image_notes = '')
91+
image_notes = '' if !image_notes
92+
image_name = 'Captured Image' if !image_name
93+
9194
disk_filter = lambda { |disk| disk['device'] == '0' }
9295
disk_filter = lambda { |disk| disk['device'] != '1' } if include_attached_storage
9396

9497
disks = self.blockDevices.select(&disk_filter)
9598

96-
self.service.createArchiveTransaction(image_name, disks, notes ? notes : "") if disks && !disks.empty?
99+
self.service.createArchiveTransaction(image_name, disks, image_notes) if disks && !disks.empty?
97100

98101
image_templates = SoftLayer::ImageTemplate.find_private_templates(:name => image_name)
99102
image_templates[0] if !image_templates.empty?

spec/BareMetalServerOrder_Package_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
end
5656

5757
it "places its :hostname attribute into the hardware template in the order" do
58-
expect(test_order.hardware_order['hardware']['hostname']).to be_nil
58+
expect(test_order.hardware_order['hardware'][0]['hostname']).to be_nil
5959
test_order.hostname = "testhostname"
60-
expect(test_order.hardware_order['hardware']['hostname']).to eq "testhostname"
60+
expect(test_order.hardware_order['hardware'][0]['hostname']).to eq "testhostname"
6161
end
6262

6363
it "places its :domain attribute into into the hardware template in the order" do
64-
expect(test_order.hardware_order['hardware']['domain']).to be_nil
64+
expect(test_order.hardware_order['hardware'][0]['domain']).to be_nil
6565
test_order.domain = "softlayer.com"
66-
expect(test_order.hardware_order['hardware']['domain']).to eq "softlayer.com"
66+
expect(test_order.hardware_order['hardware'][0]['domain']).to eq "softlayer.com"
6767
end
6868

6969
it "places config options as prices in the order" do

0 commit comments

Comments
 (0)